U
    k7g                     @   s   d Z ddlmZ ddlmZmZmZmZ ddlmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ G dd	 d	eZG d
d deZdS )a  
    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.
    )datetime)AnyDictOptionalUnion)deserialize	serializevalues)InstanceResource)ListResource)Versionc                       sJ   e Zd ZG dd deZeeeef d fddZ	edddZ
  ZS )	KeyInstancec                   @   s   e Zd ZdZdS )KeyInstance.KeytypeZ
restrictedN)__name__
__module____qualname__Z
RESTRICTED r   r   :/tmp/pip-unpacked-wheel-qtbjxrb6/twilio/rest/iam/v1/key.pyKeytype   s   r   )versionpayloadc                    sd   t  | |d| _|d| _t|d| _t|d| _|d| _	|d| _
d S )Nsidfriendly_namedate_createddate_updatedsecretpolicy)super__init__getr   r   r   Zrfc2822_datetimer   r   r   r   )selfr   r   	__class__r   r   r   &   s    zKeyInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z<Twilio.Iam.V1.KeyInstance>r   r    r   r   r   __repr__4   s    zKeyInstance.__repr__)r   r   r   objectr   r   r   strr   r   r'   __classcell__r   r   r!   r   r      s   r   c                       s   e Zd Zed fddZejejejfeeee	f ede	f ee	e	f e
dddZejejejfeeee	f ede	f ee	e	f e
ddd	Zed
ddZ  ZS )KeyList)r   c                    s   t  | d| _dS )ze
        Initialize the KeyList

        :param version: Version that contains the resource

        z/KeysN)r   r   _uri)r    r   r!   r   r   r   @   s    zKeyList.__init__r   )account_sidr   key_typer   r$   c                 C   sJ   t |||t|d}t ddi}| jjd| j||d}t| j|S )a  
        Create the KeyInstance

        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param key_type:
        :param policy: The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).

        :returns: The created KeyInstance
        Z
AccountSidZFriendlyNameZKeyTypePolicyContent-Type!application/x-www-form-urlencodedPOSTmethoduridataheaders)r	   ofr   r(   _versioncreater,   r   r    r-   r   r.   r   r7   r8   r   r   r   r   r;   K   s       zKeyList.createc                    sP   t |||t|d}t ddi}| jjd| j||dI dH }t| j|S )a  
        Asynchronously create the KeyInstance

        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
        :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
        :param key_type:
        :param policy: The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).

        :returns: The created KeyInstance
        r/   r1   r2   r3   r4   N)r	   r9   r   r(   r:   create_asyncr,   r   r<   r   r   r   r=   m   s       zKeyList.create_asyncr#   c                 C   s   dS )r%   z<Twilio.Iam.V1.KeyList>r   r&   r   r   r   r'      s    zKeyList.__repr__)r   r   r   r   r   r	   Zunsetr)   r   r(   r   r;   r=   r'   r*   r   r   r!   r   r+   >   s,   


%


"r+   N)__doc__r   typingr   r   r   r   Ztwilio.baser   r   r	   Ztwilio.base.instance_resourcer
   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r+   r   r   r   r   <module>   s   &