<?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\BLIKExperienceContext;
use PaypalServerSDKLib\Models\BLIKLevel0PaymentObject;
use PaypalServerSDKLib\Models\BLIKOneClickPaymentRequest;
use PaypalServerSDKLib\Models\BLIKPaymentRequest;

/**
 * Builder for model BLIKPaymentRequest
 *
 * @see BLIKPaymentRequest
 */
class BLIKPaymentRequestBuilder
{
    /**
     * @var BLIKPaymentRequest
     */
    private $instance;

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

    /**
     * Initializes a new blikpayment request Builder object.
     */
    public static function init(string $name, string $countryCode): self
    {
        return new self(new BLIKPaymentRequest($name, $countryCode));
    }

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

    /**
     * Sets experience context field.
     */
    public function experienceContext(?BLIKExperienceContext $value): self
    {
        $this->instance->setExperienceContext($value);
        return $this;
    }

    /**
     * Sets level 0 field.
     */
    public function level0(?BLIKLevel0PaymentObject $value): self
    {
        $this->instance->setLevel0($value);
        return $this;
    }

    /**
     * Sets one click field.
     */
    public function oneClick(?BLIKOneClickPaymentRequest $value): self
    {
        $this->instance->setOneClick($value);
        return $this;
    }

    /**
     * Initializes a new blikpayment request object.
     */
    public function build(): BLIKPaymentRequest
    {
        return CoreHelper::clone($this->instance);
    }
}
