<?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\ApplePayDecryptedTokenData;
use PaypalServerSDKLib\Models\ApplePayPaymentData;
use PaypalServerSDKLib\Models\ApplePayTokenizedCard;
use PaypalServerSDKLib\Models\Money;

/**
 * Builder for model ApplePayDecryptedTokenData
 *
 * @see ApplePayDecryptedTokenData
 */
class ApplePayDecryptedTokenDataBuilder
{
    /**
     * @var ApplePayDecryptedTokenData
     */
    private $instance;

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

    /**
     * Initializes a new apple pay decrypted token data Builder object.
     */
    public static function init(ApplePayTokenizedCard $tokenizedCard): self
    {
        return new self(new ApplePayDecryptedTokenData($tokenizedCard));
    }

    /**
     * Sets transaction amount field.
     */
    public function transactionAmount(?Money $value): self
    {
        $this->instance->setTransactionAmount($value);
        return $this;
    }

    /**
     * Sets device manufacturer id field.
     */
    public function deviceManufacturerId(?string $value): self
    {
        $this->instance->setDeviceManufacturerId($value);
        return $this;
    }

    /**
     * Sets payment data type field.
     */
    public function paymentDataType(?string $value): self
    {
        $this->instance->setPaymentDataType($value);
        return $this;
    }

    /**
     * Sets payment data field.
     */
    public function paymentData(?ApplePayPaymentData $value): self
    {
        $this->instance->setPaymentData($value);
        return $this;
    }

    /**
     * Initializes a new apple pay decrypted token data object.
     */
    public function build(): ApplePayDecryptedTokenData
    {
        return CoreHelper::clone($this->instance);
    }
}
