<?php

declare(strict_types=1);

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

namespace PayPalRESTAPIsLib\Models\Builders;

use Core\Utils\CoreHelper;
use PayPalRESTAPIsLib\Models\ACHDebitResponse;
use PayPalRESTAPIsLib\Models\BankPaymentToken;
use PayPalRESTAPIsLib\Models\SEPADebitResponse;

/**
 * Builder for model BankPaymentToken
 *
 * @see BankPaymentToken
 */
class BankPaymentTokenBuilder
{
    /**
     * @var BankPaymentToken
     */
    private $instance;

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

    /**
     * Initializes a new bank payment token Builder object.
     */
    public static function init(): self
    {
        return new self(new BankPaymentToken());
    }

    /**
     * Sets ach debit field.
     */
    public function achDebit(?ACHDebitResponse $value): self
    {
        $this->instance->setAchDebit($value);
        return $this;
    }

    /**
     * Sets sepa debit field.
     */
    public function sepaDebit(?SEPADebitResponse $value): self
    {
        $this->instance->setSepaDebit($value);
        return $this;
    }

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