<?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\CardAuthenticationResponse;
use PaypalServerSDKLib\Models\ThreeDSecureAuthenticationResponse;

/**
 * Builder for model CardAuthenticationResponse
 *
 * @see CardAuthenticationResponse
 */
class CardAuthenticationResponseBuilder
{
    /**
     * @var CardAuthenticationResponse
     */
    private $instance;

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

    /**
     * Initializes a new card authentication response Builder object.
     */
    public static function init(): self
    {
        return new self(new CardAuthenticationResponse());
    }

    /**
     * Sets three d secure field.
     */
    public function threeDSecure(?ThreeDSecureAuthenticationResponse $value): self
    {
        $this->instance->setThreeDSecure($value);
        return $this;
    }

    /**
     * Initializes a new card authentication response object.
     */
    public function build(): CardAuthenticationResponse
    {
        return CoreHelper::clone($this->instance);
    }
}
