U
    ^g%i3                     @   st   d Z ddl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)	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 )BulkConsentsInstancea  
    :ivar items: A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `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items)super__init__getr   )selfr   r   	__class__ d/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/accounts/v1/bulk_consents.pyr      s    zBulkConsentsInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z)<Twilio.Accounts.V1.BulkConsentsInstance>r   r   r   r   r   __repr__!   s    zBulkConsentsInstance.__repr__)__name__
__module____qualname____doc__r
   r   strr   r   r   __classcell__r   r   r   r   r      s   r   c                       sX   e Zd Zed fddZee edddZee edddZ	e
d	d
dZ  ZS )BulkConsentsList)r   c                    s   t  | d| _dS )zn
        Initialize the BulkConsentsList

        :param version: Version that contains the resource

        z/Consents/BulkN)r   r   _uri)r   r   r   r   r   r   -   s    zBulkConsentsList.__init__)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  
        Create the BulkConsentsInstance

        :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]; `date_of_consent`, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty.

        :returns: The created BulkConsentsInstance
        Itemsc                 S   s
   t | S Nr   objecter   r   r   <lambda>C       z)BulkConsentsList.create.<locals>.<lambda>Content-Type!application/x-www-form-urlencodedapplication/jsonAcceptPOSTmethoduridataheaders)r   ofr   map_versioncreater#   r   r   r   r4   r5   r   r   r   r   r9   8   s    	    zBulkConsentsList.createc                    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 create the BulkConsentsInstance

        :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]; `date_of_consent`, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty.

        :returns: The created BulkConsentsInstance
        r$   c                 S   s
   t | S r%   r&   r(   r   r   r   r*   ]   r+   z/BulkConsentsList.create_async.<locals>.<lambda>r,   r-   r.   r/   r0   r1   N)r   r6   r   r7   r8   create_asyncr#   r   r:   r   r   r   r;   R   s    	    zBulkConsentsList.create_asyncr   c                 C   s   dS )r   z%<Twilio.Accounts.V1.BulkConsentsList>r   r   r   r   r   r   l   s    zBulkConsentsList.__repr__)r   r   r   r
   r   r   r'   r   r9   r;   r    r   r!   r   r   r   r   r"   +   s   r"   N)r   typingr   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   