
    d{i'+                         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 ddlmZ  G d d	e      Z G d
 de      Zy)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)ApiResponse)InstanceResource)ListResource)Versionc                   B     e Zd ZdZdedeeef   f fdZdefdZ	 x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                 P    t         |   |       |j                  d      | _        y )Npermissions)super__init__getr   )selfr   r   	__class__s      n/home/sas/my/fyp/ringai/.venv/lib/python3.12/site-packages/twilio/rest/accounts/v1/messaging_geopermissions.pyr   z(MessagingGeopermissionsInstance.__init__   s!    !8?M8R    returnc                      y)f
        Provide a friendly representation

        :returns: Machine friendly representation
        z4<Twilio.Accounts.V1.MessagingGeopermissionsInstance> r   s    r   __repr__z(MessagingGeopermissionsInstance.__repr__"   s     Fr   )__name__
__module____qualname____doc__r   r   strr   r   r    __classcell__r   s   @r   r   r      s4    S S$sCx. S
F# Fr   r   c                       e Zd Zdef fdZej                  fdeee	f   de
fdZej                  fdeee	f   defdZej                  fdeee	f   defdZej                  fdeee	f   de
fdZej                  fdeee	f   defd	Zej                  fdeee	f   defd
Zdee	   de
fdZdee	   defdZdee	   defdZdee	   de
fdZdee	   defdZdee	   defdZdefdZ xZS )MessagingGeopermissionsListr   c                 2    t         |   |       d| _        y)zy
        Initialize the MessagingGeopermissionsList

        :param version: Version that contains the resource

        z/Messaging/GeoPermissionsN)r   r   _uri)r   r   r   s     r   r   z$MessagingGeopermissionsList.__init__.   s     	!/	r   country_coder   c                     t        j                  ddi      }d|d<   t        j                  d|i      }| j                  j                  d| j                  ||      S )zz
        Internal helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        Content-Type!application/x-www-form-urlencodedapplication/jsonAcceptCountryCodeGETmethoduriheadersparams)r	   of_versionfetch_with_response_infor+   r   r,   r7   r8   s       r   _fetchz"MessagingGeopermissionsList._fetch9   se     ))^-PQR.|
 }}55dii 6 
 	
r   c                 Z    | j                  |      \  }}}t        | j                  |      S )a  
        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
        r,   )r=   r   r:   r   r,   r   _s       r   fetchz!MessagingGeopermissionsList.fetchN   s+     >A.t}}gFFr   c                 v    | j                  |      \  }}}t        | j                  |      }t        |||      S )a=  
        Fetch the MessagingGeopermissionsInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        r?   datastatus_coder7   )r=   r   r:   r
   r   r,   r   rF   r7   instances         r   fetch_with_http_infoz0MessagingGeopermissionsList.fetch_with_http_infoZ   s:     )-(N%g24=='Jk7SSr   c                    K   t        j                  ddi      }d|d<   t        j                  d|i      }| j                  j                  d| j                  ||       d{   S 7 w)	z
        Internal async helper for fetch operation

        Returns:
            tuple: (payload, status_code, headers)
        r.   r/   r0   r1   r2   r3   r4   N)r	   r9   r:   fetch_with_response_info_asyncr+   r<   s       r   _fetch_asyncz(MessagingGeopermissionsList._fetch_asyncg   st      ))^-PQR.|
 ]]AAdii B 
 
 	
 
s   A A)"A'#A)c                 v   K   | j                  |       d{   \  }}}t        | j                  |      S 7 w)a'  
        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
        r?   N)rL   r   r:   r@   s       r   fetch_asyncz'MessagingGeopermissionsList.fetch_async~   s;      #//\/JJA.t}}gFF K   979c                    K   | j                  |       d{   \  }}}t        | j                  |      }t        |||      S 7 ,w)aL  
        Asynchronously fetch the MessagingGeopermissionsInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        r?   NrD   )rL   r   r:   r
   rG   s         r   fetch_with_http_info_asyncz6MessagingGeopermissionsList.fetch_with_http_info_async   sS      /3.?.?% /@ /
 )
%g 34=='Jk7SS	)
   AA-Ar   c                     t        j                  dt        j                  |d       i      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      S )	z{
        Internal helper for update operation

        Returns:
            tuple: (payload, status_code, headers)
        Permissionsc                 ,    t        j                  |       S Nr   objectes    r   <lambda>z5MessagingGeopermissionsList._update.<locals>.<lambda>       9+;+;A+> r   r.   r/   r0   r1   PATCHr5   r6   rE   r7   )r	   r9   r   mapr:   update_with_response_infor+   r   r   rE   r7   s       r   _updatez#MessagingGeopermissionsList._update   s~     yyy}}!> 
 ))^-PQR"E.}}66		g 7 
 	
r   c                 Z    | j                  |      \  }}}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 updated MessagingGeopermissionsInstance
        r   )rb   r   r:   r   r   r   rA   s       r   updatez"MessagingGeopermissionsList.update   s+     =A.t}}gFFr   c                 v    | j                  |      \  }}}t        | j                  |      }t        |||      S )a  
        Update the MessagingGeopermissionsInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        rd   rD   )rb   r   r:   r
   r   r   r   rF   r7   rH   s         r   update_with_http_infoz1MessagingGeopermissionsList.update_with_http_info   s:     )-(M%g24=='Jk7SSr   c                 
  K   t        j                  dt        j                  |d       i      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d	{   S 7 w)
z
        Internal async helper for update operation

        Returns:
            tuple: (payload, status_code, headers)
        rT   c                 ,    t        j                  |       S rV   rW   rY   s    r   r[   z;MessagingGeopermissionsList._update_async.<locals>.<lambda>   r\   r   r.   r/   r0   r1   r]   r^   N)r	   r9   r   r_   r:   update_with_response_info_asyncr+   ra   s       r   _update_asyncz)MessagingGeopermissionsList._update_async   s      yyy}}!> 
 ))^-PQR"E.]]BB		g C 
 
 	
 
s   A:B<B=Bc                 v   K   | j                  |       d{   \  }}}t        | j                  |      S 7 w)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 updated MessagingGeopermissionsInstance
        rd   N)rm   r   r:   re   s       r   update_asyncz(MessagingGeopermissionsList.update_async   s;      #00[0IIA.t}}gFF JrO   c                    K   | j                  |       d{   \  }}}t        | j                  |      }t        |||      S 7 ,w)a'  
        Asynchronously update the MessagingGeopermissionsInstance and return response metadata

        :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: ApiResponse with instance, status code, and headers
        rd   NrD   )rm   r   r:   r
   rh   s         r   update_with_http_info_asyncz7MessagingGeopermissionsList.update_with_http_info_async   sS      /3.@.@# /A /
 )
%g 34=='Jk7SS	)
rR   c                      y)r   z0<Twilio.Accounts.V1.MessagingGeopermissionsList>r   r   s    r   r    z$MessagingGeopermissionsList.__repr__   s     Br   )r!   r"   r#   r   r   r	   unsetr   r%   rX   tupler=   r   rB   r
   rI   rL   rN   rQ   r   rb   rf   ri   rm   ro   rq   r    r&   r'   s   @r   r)   r)   ,   s   	0 	0 9? 
5f#5 
 
, 28
G!#v+.
G	(
G 28T!#v+.T	T 28
!#v+.
	
0 28
G!#v+.
G	(
G 28T!#v+.T	T
4< 
E 
2	G$v, 	G3R 	G
Tf 
T+ 
T
tF| 
 
2G<G	(GT<T	T B# Br   r)   N)r$   typingr   r   r   r   r   twilio.baser   r	   twilio.base.api_responser
   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   r   r)   r   r   r   <module>r{      s@    4 3 ) 0 : 2 'F&6 F(YB, YBr   