<?php

declare(strict_types=1);

/*
 * PaypalServerSDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

namespace PaypalServerSDKLib\Models\Builders;

use Core\Utils\CoreHelper;
use PaypalServerSDKLib\Models\ExperienceContext;
use PaypalServerSDKLib\Models\IDEALPaymentRequest;

/**
 * Builder for model IDEALPaymentRequest
 *
 * @see IDEALPaymentRequest
 */
class IDEALPaymentRequestBuilder
{
    /**
     * @var IDEALPaymentRequest
     */
    private $instance;

    private function __construct(IDEALPaymentRequest $instance)
    {
        $this->instance = $instance;
    }

    /**
     * Initializes a new idealpayment request Builder object.
     */
    public static function init(string $name, string $countryCode): self
    {
        return new self(new IDEALPaymentRequest($name, $countryCode));
    }

    /**
     * Sets bic field.
     */
    public function bic(?string $value): self
    {
        $this->instance->setBic($value);
        return $this;
    }

    /**
     * Sets experience context field.
     */
    public function experienceContext(?ExperienceContext $value): self
    {
        $this->instance->setExperienceContext($value);
        return $this;
    }

    /**
     * Initializes a new idealpayment request object.
     */
    public function build(): IDEALPaymentRequest
    {
        return CoreHelper::clone($this->instance);
    }
}
