<?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\AppSwitchContext;
use PaypalServerSdkLib\Models\VaultExperienceContext;

/**
 * Builder for model VaultExperienceContext
 *
 * @see VaultExperienceContext
 */
class VaultExperienceContextBuilder
{
    /**
     * @var VaultExperienceContext
     */
    private $instance;

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

    /**
     * Initializes a new Vault Experience Context Builder object.
     */
    public static function init(): self
    {
        return new self(new VaultExperienceContext());
    }

    /**
     * Sets brand name field.
     *
     * @param string|null $value
     */
    public function brandName(?string $value): self
    {
        $this->instance->setBrandName($value);
        return $this;
    }

    /**
     * Sets locale field.
     *
     * @param string|null $value
     */
    public function locale(?string $value): self
    {
        $this->instance->setLocale($value);
        return $this;
    }

    /**
     * Sets return url field.
     *
     * @param string|null $value
     */
    public function returnUrl(?string $value): self
    {
        $this->instance->setReturnUrl($value);
        return $this;
    }

    /**
     * Sets cancel url field.
     *
     * @param string|null $value
     */
    public function cancelUrl(?string $value): self
    {
        $this->instance->setCancelUrl($value);
        return $this;
    }

    /**
     * Sets shipping preference field.
     *
     * @param string|null $value
     */
    public function shippingPreference(?string $value): self
    {
        $this->instance->setShippingPreference($value);
        return $this;
    }

    /**
     * Sets vault instruction field.
     *
     * @param string|null $value
     */
    public function vaultInstruction(?string $value): self
    {
        $this->instance->setVaultInstruction($value);
        return $this;
    }

    /**
     * Sets app switch context field.
     *
     * @param AppSwitchContext|null $value
     */
    public function appSwitchContext(?AppSwitchContext $value): self
    {
        $this->instance->setAppSwitchContext($value);
        return $this;
    }

    /**
     * Sets user action field.
     *
     * @param string|null $value
     */
    public function userAction(?string $value): self
    {
        $this->instance->setUserAction($value);
        return $this;
    }

    /**
     * Initializes a new Vault Experience Context object.
     */
    public function build(): VaultExperienceContext
    {
        return CoreHelper::clone($this->instance);
    }
}
