<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Twilio - Verify
 * This is the public Twilio REST API.
 *
 * NOTE: This class is auto generated by OpenAPI Generator.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Twilio\Rest\Verify\V2\Service;

use Twilio\Values;
abstract class NewFactorModels
{
    /**
     * @property string $id
     * @property string $name
     * @property string[] $origins
    */
    public static function createCreateNewPasskeysFactorRequestConfigRelyingParty(array $payload = []): CreateNewPasskeysFactorRequestConfigRelyingParty
    {
        return new CreateNewPasskeysFactorRequestConfigRelyingParty($payload);
    }

    /**
     * @property CreateNewPasskeysFactorRequestConfigRelyingParty $relyingParty
     * @property string $authenticatorAttachment
     * @property string $discoverableCredentials
     * @property string $userVerification
    */
    public static function createCreateNewPasskeysFactorRequestConfig(array $payload = []): CreateNewPasskeysFactorRequestConfig
    {
        return new CreateNewPasskeysFactorRequestConfig($payload);
    }

    /**
     * @property string $friendlyName
     * @property string $identity
     * @property CreateNewPasskeysFactorRequestConfig $config
    */
    public static function createCreateNewPasskeysFactorRequest(array $payload = []): CreateNewPasskeysFactorRequest
    {
        return new CreateNewPasskeysFactorRequest($payload);
    }

}

class CreateNewPasskeysFactorRequestConfigRelyingParty implements \JsonSerializable
{
    /**
     * @property string $id
     * @property string $name
     * @property string[] $origins
    */
        protected $id;
        protected $name;
        protected $origins;
    public function __construct(array $payload = []) {
        $this->id = Values::array_get($payload, 'id');
        $this->name = Values::array_get($payload, 'name');
        $this->origins = Values::array_get($payload, 'origins');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->id)) {
            $jsonString['id'] = $this->id;
        }
        if (isset($this->name)) {
            $jsonString['name'] = $this->name;
        }
        if (isset($this->origins)) {
            $jsonString['origins'] = $this->origins;
        }
        return $jsonString;
    }
}

class CreateNewPasskeysFactorRequestConfig implements \JsonSerializable
{
    /**
     * @property CreateNewPasskeysFactorRequestConfigRelyingParty $relyingParty
     * @property string $authenticatorAttachment
     * @property string $discoverableCredentials
     * @property string $userVerification
    */
        protected $relyingParty;
        protected $authenticatorAttachment;
        protected $discoverableCredentials;
        protected $userVerification;
    public function __construct(array $payload = []) {
        $this->relyingParty = Values::array_get($payload, 'relying_party');
        $this->authenticatorAttachment = Values::array_get($payload, 'authenticator_attachment');
        $this->discoverableCredentials = Values::array_get($payload, 'discoverable_credentials');
        $this->userVerification = Values::array_get($payload, 'user_verification');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->relyingParty)) {
            $jsonString['relying_party'] = $this->relyingParty;
        }
        if (isset($this->authenticatorAttachment)) {
            $jsonString['authenticator_attachment'] = $this->authenticatorAttachment;
        }
        if (isset($this->discoverableCredentials)) {
            $jsonString['discoverable_credentials'] = $this->discoverableCredentials;
        }
        if (isset($this->userVerification)) {
            $jsonString['user_verification'] = $this->userVerification;
        }
        return $jsonString;
    }
}

class CreateNewPasskeysFactorRequest implements \JsonSerializable
{
    /**
     * @property string $friendlyName
     * @property string $identity
     * @property CreateNewPasskeysFactorRequestConfig $config
    */
        protected $friendlyName;
        protected $identity;
        protected $config;
    public function __construct(array $payload = []) {
        $this->friendlyName = Values::array_get($payload, 'friendly_name');
        $this->identity = Values::array_get($payload, 'identity');
        $this->config = Values::array_get($payload, 'config');
    }

    public function toArray(): array
    {
        return $this->jsonSerialize();
    }

    public function jsonSerialize(): array
    {
        $jsonString = [
            'friendly_name' => $this->friendlyName,
            'identity' => $this->identity
        ];
        if (isset($this->config)) {
            $jsonString['config'] = $this->config;
        }
        return $jsonString;
    }
}

