U
    ^g%i                     @   sx   d Z ddlmZmZmZmZmZ ddl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 - Accounts
    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.
    )AnyDictListOptionalUnion)	serializevalues)InstanceResource)ListResource)Versionc                       s>   e Zd ZdZeeeef d fddZedddZ	  Z
S )MessagingGeopermissionsInstanceam  
    :ivar permissions: A list of objects where each object represents the result of processing a messaging Geo Permission. Each object contains the following fields: `country_code`, the country code of the country for which the permission was updated; `type`, the type of the permission i.e. country; `enabled`, true if the permission is enabled else false; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
    )versionpayloadc                    s   t  | |d| _d S )Npermissions)super__init__getr   )selfr   r   	__class__ o/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/accounts/v1/messaging_geopermissions.pyr      s    z(MessagingGeopermissionsInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z4<Twilio.Accounts.V1.MessagingGeopermissionsInstance>r   r   r   r   r   __repr__!   s    z(MessagingGeopermissionsInstance.__repr__)__name__
__module____qualname____doc__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feee	f e
dddZejfeee	f e
dddZee	 e
d	d
dZee	 e
d	ddZedddZ  ZS )MessagingGeopermissionsList)r   c                    s   t  | d| _dS )zy
        Initialize the MessagingGeopermissionsList

        :param version: Version that contains the resource

        z/Messaging/GeoPermissionsN)r   r   _uri)r   r   r   r   r   r   -   s    z$MessagingGeopermissionsList.__init__)country_coder   c                 C   sF   t ddi}d|d< t d|i}| jjd| j||d}t| j|S )'  
        Asynchronously fetch the MessagingGeopermissionsInstance

        :param country_code: The country code to filter the geo permissions. If provided, only the geo permission for the specified country will be returned.
        :returns: The fetched MessagingGeopermissionsInstance
        Content-Type!application/x-www-form-urlencodedapplication/jsonAcceptCountryCodeGETmethoduriheadersparams)r   of_versionfetchr$   r   r   r%   r0   r1   r   r   r   r   r4   8   s    	    z!MessagingGeopermissionsList.fetchc                    sL   t ddi}d|d< t d|i}| jjd| j||dI dH }t| j|S )	r&   r'   r(   r)   r*   r+   r,   r-   N)r   r2   r3   fetch_asyncr$   r   r5   r   r   r   r6   Q   s    	    z'MessagingGeopermissionsList.fetch_async)r   r   c                 C   sZ   t dt|dd i}t ddi}d|d< d|d< | jjd| j||d	}t| j|S )
a  
        Update the MessagingGeopermissionsInstance

        :param permissions: A list of objects where each object represents the Geo Permission to be updated. Each object contains the following fields: `country_code`, unique code for each country of Geo Permission; `type`, permission type of the Geo Permission i.e. country; `enabled`, configure true for enabling the Geo Permission, false for disabling the Geo Permission.

        :returns: The created MessagingGeopermissionsInstance
        Permissionsc                 S   s
   t | S Nr   objecter   r   r   <lambda>v       z4MessagingGeopermissionsList.update.<locals>.<lambda>r'   r(   r)   r*   PATCHr.   r/   datar0   )r   r2   r   mapr3   updater$   r   r   r   rA   r0   r   r   r   r   rC   j   s$    	     z"MessagingGeopermissionsList.updatec                    s`   t dt|dd i}t ddi}d|d< d|d< | jjd| j||d	I d
H }t| j|S )a  
        Asynchronously update the MessagingGeopermissionsInstance

        :param permissions: A list of objects where each object represents the Geo Permission to be updated. Each object contains the following fields: `country_code`, unique code for each country of Geo Permission; `type`, permission type of the Geo Permission i.e. country; `enabled`, configure true for enabling the Geo Permission, false for disabling the Geo Permission.

        :returns: The created MessagingGeopermissionsInstance
        r7   c                 S   s
   t | S r8   r9   r;   r   r   r   r=      r>   z:MessagingGeopermissionsList.update_async.<locals>.<lambda>r'   r(   r)   r*   r?   r@   N)r   r2   r   rB   r3   update_asyncr$   r   rD   r   r   r   rE      s$         z(MessagingGeopermissionsList.update_asyncr   c                 C   s   dS )r   z0<Twilio.Accounts.V1.MessagingGeopermissionsList>r   r   r   r   r   r      s    z$MessagingGeopermissionsList.__repr__)r   r   r   r   r   r   unsetr   r!   r:   r   r4   r6   r   rC   rE   r   r"   r   r   r   r   r#   +   s    

r#   N)r    typingr   r   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_resourcer	   Ztwilio.base.list_resourcer
   Ztwilio.base.versionr   r   r#   r   r   r   r   <module>   s   