<?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\VaultedDigitalWallet;
use PaypalServerSDKLib\Models\VaultedDigitalWalletShippingDetails;

/**
 * Builder for model VaultedDigitalWallet
 *
 * @see VaultedDigitalWallet
 */
class VaultedDigitalWalletBuilder
{
    /**
     * @var VaultedDigitalWallet
     */
    private $instance;

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

    /**
     * Initializes a new vaulted digital wallet Builder object.
     */
    public static function init(): self
    {
        return new self(new VaultedDigitalWallet());
    }

    /**
     * Sets description field.
     */
    public function description(?string $value): self
    {
        $this->instance->setDescription($value);
        return $this;
    }

    /**
     * Sets shipping field.
     */
    public function shipping(?VaultedDigitalWalletShippingDetails $value): self
    {
        $this->instance->setShipping($value);
        return $this;
    }

    /**
     * Sets permit multiple payment tokens field.
     */
    public function permitMultiplePaymentTokens(?bool $value): self
    {
        $this->instance->setPermitMultiplePaymentTokens($value);
        return $this;
    }

    /**
     * Sets usage type field.
     */
    public function usageType(?string $value): self
    {
        $this->instance->setUsageType($value);
        return $this;
    }

    /**
     * Sets customer type field.
     */
    public function customerType(?string $value): self
    {
        $this->instance->setCustomerType($value);
        return $this;
    }

    /**
     * Initializes a new vaulted digital wallet object.
     */
    public function build(): VaultedDigitalWallet
    {
        return CoreHelper::clone($this->instance);
    }
}
