<?php

declare(strict_types=1);

/*
 * PaypalServerSDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

namespace PaypalServerSDKLib\Models;

use stdClass;

/**
 * Results of 3D Secure Authentication.
 */
class ThreeDSecureAuthenticationResponse implements \JsonSerializable
{
    /**
     * @var string|null
     */
    private $authenticationStatus;

    /**
     * @var string|null
     */
    private $enrollmentStatus;

    /**
     * Returns Authentication Status.
     * Transactions status result identifier. The outcome of the issuer's authentication.
     */
    public function getAuthenticationStatus(): ?string
    {
        return $this->authenticationStatus;
    }

    /**
     * Sets Authentication Status.
     * Transactions status result identifier. The outcome of the issuer's authentication.
     *
     * @maps authentication_status
     */
    public function setAuthenticationStatus(?string $authenticationStatus): void
    {
        $this->authenticationStatus = $authenticationStatus;
    }

    /**
     * Returns Enrollment Status.
     * Status of Authentication eligibility.
     */
    public function getEnrollmentStatus(): ?string
    {
        return $this->enrollmentStatus;
    }

    /**
     * Sets Enrollment Status.
     * Status of Authentication eligibility.
     *
     * @maps enrollment_status
     */
    public function setEnrollmentStatus(?string $enrollmentStatus): void
    {
        $this->enrollmentStatus = $enrollmentStatus;
    }

    /**
     * Encode this object to JSON
     *
     * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
     *        are set. (default: false)
     *
     * @return array|stdClass
     */
    #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
    public function jsonSerialize(bool $asArrayWhenEmpty = false)
    {
        $json = [];
        if (isset($this->authenticationStatus)) {
            $json['authentication_status'] = PAResStatus::checkValue($this->authenticationStatus);
        }
        if (isset($this->enrollmentStatus)) {
            $json['enrollment_status']     = EnrollmentStatus::checkValue($this->enrollmentStatus);
        }

        return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
    }
}
