<?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\ApplePayCard;
use PaypalServerSDKLib\Models\ApplePayPaymentToken;

/**
 * Builder for model ApplePayPaymentToken
 *
 * @see ApplePayPaymentToken
 */
class ApplePayPaymentTokenBuilder
{
    /**
     * @var ApplePayPaymentToken
     */
    private $instance;

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

    /**
     * Initializes a new apple pay payment token Builder object.
     */
    public static function init(): self
    {
        return new self(new ApplePayPaymentToken());
    }

    /**
     * Sets card field.
     */
    public function card(?ApplePayCard $value): self
    {
        $this->instance->setCard($value);
        return $this;
    }

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