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

/**
 * Builder for model SupplementaryPurchaseData
 *
 * @see SupplementaryPurchaseData
 */
class SupplementaryPurchaseDataBuilder
{
    /**
     * @var SupplementaryPurchaseData
     */
    private $instance;

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

    /**
     * Initializes a new supplementary purchase data Builder object.
     */
    public static function init(): self
    {
        return new self(new SupplementaryPurchaseData());
    }

    /**
     * Sets invoice id field.
     */
    public function invoiceId(?string $value): self
    {
        $this->instance->setInvoiceId($value);
        return $this;
    }

    /**
     * Sets note to payer field.
     */
    public function noteToPayer(?string $value): self
    {
        $this->instance->setNoteToPayer($value);
        return $this;
    }

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