<?php

declare (strict_types=1);
/*
 * PaypalServerSdkLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */
namespace FormGent\PaypalServerSdkLib\Models\Builders;

use FormGent\Core\Utils\CoreHelper;
use FormGent\PaypalServerSdkLib\Models\TrustlyPaymentObject;
/**
 * Builder for model TrustlyPaymentObject
 *
 * @see TrustlyPaymentObject
 */
class TrustlyPaymentObjectBuilder
{
    /**
     * @var TrustlyPaymentObject
     */
    private $instance;
    private function __construct(TrustlyPaymentObject $instance)
    {
        $this->instance = $instance;
    }
    /**
     * Initializes a new Trustly Payment Object Builder object.
     */
    public static function init() : self
    {
        return new self(new TrustlyPaymentObject());
    }
    /**
     * Sets name field.
     *
     * @param string|null $value
     */
    public function name(?string $value) : self
    {
        $this->instance->setName($value);
        return $this;
    }
    /**
     * Sets country code field.
     *
     * @param string|null $value
     */
    public function countryCode(?string $value) : self
    {
        $this->instance->setCountryCode($value);
        return $this;
    }
    /**
     * Sets email field.
     *
     * @param string|null $value
     */
    public function email(?string $value) : self
    {
        $this->instance->setEmail($value);
        return $this;
    }
    /**
     * Sets bic field.
     *
     * @param string|null $value
     */
    public function bic(?string $value) : self
    {
        $this->instance->setBic($value);
        return $this;
    }
    /**
     * Sets iban last chars field.
     *
     * @param string|null $value
     */
    public function ibanLastChars(?string $value) : self
    {
        $this->instance->setIbanLastChars($value);
        return $this;
    }
    /**
     * Initializes a new Trustly Payment Object object.
     */
    public function build() : TrustlyPaymentObject
    {
        return CoreHelper::clone($this->instance);
    }
}
