<?php

declare(strict_types=1);

/*
 * PayPalRESTAPIsLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

namespace PayPalRESTAPIsLib\Models\Builders;

use Core\Utils\CoreHelper;
use PayPalRESTAPIsLib\Models\ApplePayRequest;
use PayPalRESTAPIsLib\Models\CardRequest;
use PayPalRESTAPIsLib\Models\GooglePayRequest;
use PayPalRESTAPIsLib\Models\OrderAuthorizeRequestPaymentSource;
use PayPalRESTAPIsLib\Models\PayPalWallet;
use PayPalRESTAPIsLib\Models\Token;
use PayPalRESTAPIsLib\Models\VenmoWalletRequest;

/**
 * Builder for model OrderAuthorizeRequestPaymentSource
 *
 * @see OrderAuthorizeRequestPaymentSource
 */
class OrderAuthorizeRequestPaymentSourceBuilder
{
    /**
     * @var OrderAuthorizeRequestPaymentSource
     */
    private $instance;

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

    /**
     * Initializes a new order authorize request payment source Builder object.
     */
    public static function init(): self
    {
        return new self(new OrderAuthorizeRequestPaymentSource());
    }

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

    /**
     * Sets token field.
     */
    public function token(?Token $value): self
    {
        $this->instance->setToken($value);
        return $this;
    }

    /**
     * Sets paypal field.
     */
    public function paypal(?PayPalWallet $value): self
    {
        $this->instance->setPaypal($value);
        return $this;
    }

    /**
     * Sets apple pay field.
     */
    public function applePay(?ApplePayRequest $value): self
    {
        $this->instance->setApplePay($value);
        return $this;
    }

    /**
     * Sets google pay field.
     */
    public function googlePay(?GooglePayRequest $value): self
    {
        $this->instance->setGooglePay($value);
        return $this;
    }

    /**
     * Sets venmo field.
     */
    public function venmo(?VenmoWalletRequest $value): self
    {
        $this->instance->setVenmo($value);
        return $this;
    }

    /**
     * Initializes a new order authorize request payment source object.
     */
    public function build(): OrderAuthorizeRequestPaymentSource
    {
        return CoreHelper::clone($this->instance);
    }
}
