<?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\Money;
use PaypalServerSdkLib\Models\TaxAmount;

/**
 * Builder for model TaxAmount
 *
 * @see TaxAmount
 */
class TaxAmountBuilder
{
    /**
     * @var TaxAmount
     */
    private $instance;

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

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

    /**
     * Sets tax amount field.
     *
     * @param Money|null $value
     */
    public function taxAmount(?Money $value): self
    {
        $this->instance->setTaxAmount($value);
        return $this;
    }

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