<?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\CallbackConfiguration;
use PaypalServerSdkLib\Models\PaypalWalletExperienceContext;

/**
 * Builder for model PaypalWalletExperienceContext
 *
 * @see PaypalWalletExperienceContext
 */
class PaypalWalletExperienceContextBuilder
{
    /**
     * @var PaypalWalletExperienceContext
     */
    private $instance;

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

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

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

    /**
     * Sets contact preference field.
     *
     * @param string|null $value
     */
    public function contactPreference(?string $value): self
    {
        $this->instance->setContactPreference($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 app switch context field.
     *
     * @param AppSwitchContext|null $value
     */
    public function appSwitchContext(?AppSwitchContext $value): self
    {
        $this->instance->setAppSwitchContext($value);
        return $this;
    }

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

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

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

    /**
     * Sets order update callback config field.
     *
     * @param CallbackConfiguration|null $value
     */
    public function orderUpdateCallbackConfig(?CallbackConfiguration $value): self
    {
        $this->instance->setOrderUpdateCallbackConfig($value);
        return $this;
    }

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