<?php
/**
 * This code was generated by
 * ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
 *  |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
 *  |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
 *
 * Twilio - Iam
 * 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\Iam\V1;

use Twilio\Values;
abstract class OAuthAppModels
{
    /**
     * @property string[] $allow Set of permissions explicitly allowed
     * @property string[] $deny Set of permissions explicitly denied
    */
    public static function createIamV1OrganizationVendoroauthappPolicy(array $payload = []): IamV1OrganizationVendoroauthappPolicy
    {
        return new IamV1OrganizationVendoroauthappPolicy($payload);
    }

    /**
     * @property string $type
     * @property string $friendlyName
     * @property string|null $ownerSid
     * @property string $description
     * @property string|null $clientSid
     * @property IamV1OrganizationVendoroauthappPolicy $policy
     * @property int $accessTokenTtl
    */
    public static function createIamV1AccountVendorOauthAppCreateRequest(array $payload = []): IamV1AccountVendorOauthAppCreateRequest
    {
        return new IamV1AccountVendorOauthAppCreateRequest($payload);
    }

    /**
     * @property string[] $allow Set of permissions explicitly allowed
     * @property string[] $deny Set of permissions explicitly denied
    */
    public static function createIamV1OrganizationVendorOauthAppUpdateRequestPolicy(array $payload = []): IamV1OrganizationVendorOauthAppUpdateRequestPolicy
    {
        return new IamV1OrganizationVendorOauthAppUpdateRequestPolicy($payload);
    }

    /**
     * @property string|null $type
     * @property string|null $friendlyName
     * @property string|null $description
     * @property IamV1OrganizationVendorOauthAppUpdateRequestPolicy $policy
     * @property int|null $accessTokenTtl
    */
    public static function createIamV1AccountVendorOauthAppUpdateRequest(array $payload = []): IamV1AccountVendorOauthAppUpdateRequest
    {
        return new IamV1AccountVendorOauthAppUpdateRequest($payload);
    }

}

class IamV1OrganizationVendoroauthappPolicy implements \JsonSerializable
{
    /**
     * @property string[] $allow Set of permissions explicitly allowed
     * @property string[] $deny Set of permissions explicitly denied
    */
        protected $allow;
        protected $deny;
    public function __construct(array $payload = []) {
        $this->allow = Values::array_get($payload, 'allow');
        $this->deny = Values::array_get($payload, 'deny');
    }

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

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

class IamV1AccountVendorOauthAppCreateRequest implements \JsonSerializable
{
    /**
     * @property string $type
     * @property string $friendlyName
     * @property string|null $ownerSid
     * @property string $description
     * @property string|null $clientSid
     * @property IamV1OrganizationVendoroauthappPolicy $policy
     * @property int $accessTokenTtl
    */
        protected $type;
        protected $friendlyName;
        protected $ownerSid;
        protected $description;
        protected $clientSid;
        protected $policy;
        protected $accessTokenTtl;
    public function __construct(array $payload = []) {
        $this->type = Values::array_get($payload, 'type');
        $this->friendlyName = Values::array_get($payload, 'friendly_name');
        $this->ownerSid = Values::array_get($payload, 'owner_sid');
        $this->description = Values::array_get($payload, 'description');
        $this->clientSid = Values::array_get($payload, 'client_sid');
        $this->policy = Values::array_get($payload, 'policy');
        $this->accessTokenTtl = Values::array_get($payload, 'access_token_ttl');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->type)) {
            $jsonString['type'] = $this->type;
        }
        if (isset($this->friendlyName)) {
            $jsonString['friendly_name'] = $this->friendlyName;
        }
        if (isset($this->ownerSid)) {
            $jsonString['owner_sid'] = $this->ownerSid;
        }
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->clientSid)) {
            $jsonString['client_sid'] = $this->clientSid;
        }
        if (isset($this->policy)) {
            $jsonString['policy'] = $this->policy;
        }
        if (isset($this->accessTokenTtl)) {
            $jsonString['access_token_ttl'] = $this->accessTokenTtl;
        }
        return $jsonString;
    }
}

class IamV1OrganizationVendorOauthAppUpdateRequestPolicy implements \JsonSerializable
{
    /**
     * @property string[] $allow Set of permissions explicitly allowed
     * @property string[] $deny Set of permissions explicitly denied
    */
        protected $allow;
        protected $deny;
    public function __construct(array $payload = []) {
        $this->allow = Values::array_get($payload, 'allow');
        $this->deny = Values::array_get($payload, 'deny');
    }

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

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

class IamV1AccountVendorOauthAppUpdateRequest implements \JsonSerializable
{
    /**
     * @property string|null $type
     * @property string|null $friendlyName
     * @property string|null $description
     * @property IamV1OrganizationVendorOauthAppUpdateRequestPolicy $policy
     * @property int|null $accessTokenTtl
    */
        protected $type;
        protected $friendlyName;
        protected $description;
        protected $policy;
        protected $accessTokenTtl;
    public function __construct(array $payload = []) {
        $this->type = Values::array_get($payload, 'type');
        $this->friendlyName = Values::array_get($payload, 'friendly_name');
        $this->description = Values::array_get($payload, 'description');
        $this->policy = Values::array_get($payload, 'policy');
        $this->accessTokenTtl = Values::array_get($payload, 'access_token_ttl');
    }

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

    public function jsonSerialize(): array
    {
        $jsonString = [
        ];
        if (isset($this->type)) {
            $jsonString['type'] = $this->type;
        }
        if (isset($this->friendlyName)) {
            $jsonString['friendly_name'] = $this->friendlyName;
        }
        if (isset($this->description)) {
            $jsonString['description'] = $this->description;
        }
        if (isset($this->policy)) {
            $jsonString['policy'] = $this->policy;
        }
        if (isset($this->accessTokenTtl)) {
            $jsonString['access_token_ttl'] = $this->accessTokenTtl;
        }
        return $jsonString;
    }
}

