<?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\Address;
use PayPalRESTAPIsLib\Models\SEPADebitAuthorizationDetails;
use PayPalRESTAPIsLib\Models\SEPADebitResponse;

/**
 * Builder for model SEPADebitResponse
 *
 * @see SEPADebitResponse
 */
class SEPADebitResponseBuilder
{
    /**
     * @var SEPADebitResponse
     */
    private $instance;

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

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

    /**
     * Sets iban last chars field.
     */
    public function ibanLastChars(?string $value): self
    {
        $this->instance->setIbanLastChars($value);
        return $this;
    }

    /**
     * Sets account holder name field.
     */
    public function accountHolderName($value): self
    {
        $this->instance->setAccountHolderName($value);
        return $this;
    }

    /**
     * Sets billing address field.
     */
    public function billingAddress(?Address $value): self
    {
        $this->instance->setBillingAddress($value);
        return $this;
    }

    /**
     * Sets authorization details field.
     */
    public function authorizationDetails(?SEPADebitAuthorizationDetails $value): self
    {
        $this->instance->setAuthorizationDetails($value);
        return $this;
    }

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