<?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\EPSPaymentObject;

/**
 * Builder for model EPSPaymentObject
 *
 * @see EPSPaymentObject
 */
class EPSPaymentObjectBuilder
{
    /**
     * @var EPSPaymentObject
     */
    private $instance;

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

    /**
     * Initializes a new epspayment object Builder object.
     */
    public static function init(): self
    {
        return new self(new EPSPaymentObject());
    }

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

    /**
     * Sets country code field.
     */
    public function countryCode(?string $value): self
    {
        $this->instance->setCountryCode($value);
        return $this;
    }

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

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