_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q29300
FieldTypeInstance.update
train
def update(self, friendly_name=values.unset, unique_name=values.unset): """ Update the FieldTypeInstance :param unicode friendly_name: A string to describe the resource :param unicode unique_name: An application-defined string that uniquely identifies the resource :returns: Updated FieldTypeInstance :rtype: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeInstance """ return self._proxy.update(friendly_name=friendly_name, unique_name=unique_name, )
python
{ "resource": "" }
q29301
MessageList.stream
train
def stream(self, to=values.unset, from_=values.unset, date_sent_before=values.unset, date_sent=values.unset, date_sent_after=values.unset, limit=None, page_size=None): """ Streams MessageInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param unicode to: Filter by messages sent to this number :param unicode from_: Filter by from number :param datetime date_sent_before: Filter by date sent :param datetime date_sent: Filter by date sent :param datetime date_sent_after: Filter by date sent :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.api.v2010.account.message.MessageInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( to=to, from_=from_, date_sent_before=date_sent_before, date_sent=date_sent, date_sent_after=date_sent_after, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29302
MessageList.page
train
def page(self, to=values.unset, from_=values.unset, date_sent_before=values.unset, date_sent=values.unset, date_sent_after=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of MessageInstance records from the API. Request is executed immediately :param unicode to: Filter by messages sent to this number :param unicode from_: Filter by from number :param datetime date_sent_before: Filter by date sent :param datetime date_sent: Filter by date sent :param datetime date_sent_after: Filter by date sent :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of MessageInstance :rtype: twilio.rest.api.v2010.account.message.MessagePage """ params = values.of({ 'To': to, 'From': from_, 'DateSent<': serialize.iso8601_datetime(date_sent_before), 'DateSent': serialize.iso8601_datetime(date_sent), 'DateSent>': serialize.iso8601_datetime(date_sent_after), 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return MessagePage(self._version, response, self._solution)
python
{ "resource": "" }
q29303
AssignedAddOnList.create
train
def create(self, installed_add_on_sid): """ Create a new AssignedAddOnInstance :param unicode installed_add_on_sid: The SID that identifies the Add-on installation :returns: Newly created AssignedAddOnInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnInstance """ data = values.of({'InstalledAddOnSid': installed_add_on_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return AssignedAddOnInstance( self._version, payload, account_sid=self._solution['account_sid'], resource_sid=self._solution['resource_sid'], )
python
{ "resource": "" }
q29304
AssignedAddOnList.get
train
def get(self, sid): """ Constructs a AssignedAddOnContext :param sid: The unique string that identifies the resource :returns: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnContext :rtype: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnContext """ return AssignedAddOnContext( self._version, account_sid=self._solution['account_sid'], resource_sid=self._solution['resource_sid'], sid=sid, )
python
{ "resource": "" }
q29305
AssignedAddOnPage.get_instance
train
def get_instance(self, payload): """ Build an instance of AssignedAddOnInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnInstance """ return AssignedAddOnInstance( self._version, payload, account_sid=self._solution['account_sid'], resource_sid=self._solution['resource_sid'], )
python
{ "resource": "" }
q29306
AssignedAddOnContext.fetch
train
def fetch(self): """ Fetch a AssignedAddOnInstance :returns: Fetched AssignedAddOnInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnInstance """ params = values.of({}) payload = self._version.fetch( 'GET', self._uri, params=params, ) return AssignedAddOnInstance( self._version, payload, account_sid=self._solution['account_sid'], resource_sid=self._solution['resource_sid'], sid=self._solution['sid'], )
python
{ "resource": "" }
q29307
HostedNumberOrderList.page
train
def page(self, status=values.unset, phone_number=values.unset, incoming_phone_number_sid=values.unset, friendly_name=values.unset, unique_name=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of HostedNumberOrderInstance records from the API. Request is executed immediately :param HostedNumberOrderInstance.Status status: The Status of this HostedNumberOrder. :param unicode phone_number: An E164 formatted phone number. :param unicode incoming_phone_number_sid: IncomingPhoneNumber sid. :param unicode friendly_name: A human readable description of this resource. :param unicode unique_name: A unique, developer assigned name of this HostedNumberOrder. :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of HostedNumberOrderInstance :rtype: twilio.rest.preview.hosted_numbers.hosted_number_order.HostedNumberOrderPage """ params = values.of({ 'Status': status, 'PhoneNumber': phone_number, 'IncomingPhoneNumberSid': incoming_phone_number_sid, 'FriendlyName': friendly_name, 'UniqueName': unique_name, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return HostedNumberOrderPage(self._version, response, self._solution)
python
{ "resource": "" }
q29308
HostedNumberOrderList.create
train
def create(self, phone_number, sms_capability, account_sid=values.unset, friendly_name=values.unset, unique_name=values.unset, cc_emails=values.unset, sms_url=values.unset, sms_method=values.unset, sms_fallback_url=values.unset, sms_fallback_method=values.unset, status_callback_url=values.unset, status_callback_method=values.unset, sms_application_sid=values.unset, address_sid=values.unset, email=values.unset, verification_type=values.unset, verification_document_sid=values.unset): """ Create a new HostedNumberOrderInstance :param unicode phone_number: An E164 formatted phone number. :param bool sms_capability: Specify SMS capability to host. :param unicode account_sid: Account Sid. :param unicode friendly_name: A human readable description of this resource. :param unicode unique_name: A unique, developer assigned name of this HostedNumberOrder. :param unicode cc_emails: A list of emails. :param unicode sms_url: SMS URL. :param unicode sms_method: SMS Method. :param unicode sms_fallback_url: SMS Fallback URL. :param unicode sms_fallback_method: SMS Fallback Method. :param unicode status_callback_url: Status Callback URL. :param unicode status_callback_method: Status Callback Method. :param unicode sms_application_sid: SMS Application Sid. :param unicode address_sid: Address sid. :param unicode email: Email. :param HostedNumberOrderInstance.VerificationType verification_type: Verification Type. :param unicode verification_document_sid: Verification Document Sid :returns: Newly created HostedNumberOrderInstance :rtype: twilio.rest.preview.hosted_numbers.hosted_number_order.HostedNumberOrderInstance """ data = values.of({ 'PhoneNumber': phone_number, 'SmsCapability': sms_capability, 'AccountSid': account_sid, 'FriendlyName': friendly_name, 'UniqueName': unique_name, 'CcEmails': serialize.map(cc_emails, lambda e: e), 'SmsUrl': sms_url, 'SmsMethod': sms_method, 'SmsFallbackUrl': sms_fallback_url, 'SmsFallbackMethod': sms_fallback_method, 'StatusCallbackUrl': status_callback_url, 'StatusCallbackMethod': status_callback_method, 'SmsApplicationSid': sms_application_sid, 'AddressSid': address_sid, 'Email': email, 'VerificationType': verification_type, 'VerificationDocumentSid': verification_document_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return HostedNumberOrderInstance(self._version, payload, )
python
{ "resource": "" }
q29309
ServiceContext.entities
train
def entities(self): """ Access the entities :returns: twilio.rest.authy.v1.service.entity.EntityList :rtype: twilio.rest.authy.v1.service.entity.EntityList """ if self._entities is None: self._entities = EntityList(self._version, service_sid=self._solution['sid'], ) return self._entities
python
{ "resource": "" }
q29310
WorkersRealTimeStatisticsPage.get_instance
train
def get_instance(self, payload): """ Build an instance of WorkersRealTimeStatisticsInstance :param dict payload: Payload response from the API :returns: twilio.rest.taskrouter.v1.workspace.worker.workers_real_time_statistics.WorkersRealTimeStatisticsInstance :rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_real_time_statistics.WorkersRealTimeStatisticsInstance """ return WorkersRealTimeStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], )
python
{ "resource": "" }
q29311
WorkersRealTimeStatisticsContext.fetch
train
def fetch(self, task_channel=values.unset): """ Fetch a WorkersRealTimeStatisticsInstance :param unicode task_channel: Filter cumulative statistics by TaskChannel. :returns: Fetched WorkersRealTimeStatisticsInstance :rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_real_time_statistics.WorkersRealTimeStatisticsInstance """ params = values.of({'TaskChannel': task_channel, }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return WorkersRealTimeStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], )
python
{ "resource": "" }
q29312
LocalList.page
train
def page(self, beta=values.unset, friendly_name=values.unset, phone_number=values.unset, origin=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of LocalInstance records from the API. Request is executed immediately :param bool beta: Whether to include new phone numbers :param unicode friendly_name: A string that identifies the resources to read :param unicode phone_number: The phone numbers of the resources to read :param unicode origin: Include phone numbers based on their origin. By default, phone numbers of all origin are included. :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of LocalInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalPage """ params = values.of({ 'Beta': beta, 'FriendlyName': friendly_name, 'PhoneNumber': phone_number, 'Origin': origin, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return LocalPage(self._version, response, self._solution)
python
{ "resource": "" }
q29313
LocalPage.get_instance
train
def get_instance(self, payload): """ Build an instance of LocalInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance """ return LocalInstance(self._version, payload, account_sid=self._solution['account_sid'], )
python
{ "resource": "" }
q29314
AuthCallsIpAccessControlListMappingList.get
train
def get(self, sid): """ Constructs a AuthCallsIpAccessControlListMappingContext :param sid: The unique string that identifies the resource :returns: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.auth_calls_ip_access_control_list_mapping.AuthCallsIpAccessControlListMappingContext :rtype: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.auth_calls_ip_access_control_list_mapping.AuthCallsIpAccessControlListMappingContext """ return AuthCallsIpAccessControlListMappingContext( self._version, account_sid=self._solution['account_sid'], domain_sid=self._solution['domain_sid'], sid=sid, )
python
{ "resource": "" }
q29315
AuthCallsIpAccessControlListMappingPage.get_instance
train
def get_instance(self, payload): """ Build an instance of AuthCallsIpAccessControlListMappingInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.auth_calls_ip_access_control_list_mapping.AuthCallsIpAccessControlListMappingInstance :rtype: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.auth_calls_ip_access_control_list_mapping.AuthCallsIpAccessControlListMappingInstance """ return AuthCallsIpAccessControlListMappingInstance( self._version, payload, account_sid=self._solution['account_sid'], domain_sid=self._solution['domain_sid'], )
python
{ "resource": "" }
q29316
IpAccessControlListList.create
train
def create(self, ip_access_control_list_sid): """ Create a new IpAccessControlListInstance :param unicode ip_access_control_list_sid: The SID of the IP Access Control List that you want to associate with the trunk :returns: Newly created IpAccessControlListInstance :rtype: twilio.rest.trunking.v1.trunk.ip_access_control_list.IpAccessControlListInstance """ data = values.of({'IpAccessControlListSid': ip_access_control_list_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return IpAccessControlListInstance(self._version, payload, trunk_sid=self._solution['trunk_sid'], )
python
{ "resource": "" }
q29317
SubscribedTrackList.stream
train
def stream(self, date_created_after=values.unset, date_created_before=values.unset, track=values.unset, publisher=values.unset, kind=values.unset, limit=None, page_size=None): """ Streams SubscribedTrackInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param datetime date_created_after: The date_created_after :param datetime date_created_before: The date_created_before :param unicode track: The track :param unicode publisher: The publisher :param SubscribedTrackInstance.Kind kind: The kind :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( date_created_after=date_created_after, date_created_before=date_created_before, track=track, publisher=publisher, kind=kind, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29318
SubscribedTrackList.page
train
def page(self, date_created_after=values.unset, date_created_before=values.unset, track=values.unset, publisher=values.unset, kind=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of SubscribedTrackInstance records from the API. Request is executed immediately :param datetime date_created_after: The date_created_after :param datetime date_created_before: The date_created_before :param unicode track: The track :param unicode publisher: The publisher :param SubscribedTrackInstance.Kind kind: The kind :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of SubscribedTrackInstance :rtype: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackPage """ params = values.of({ 'DateCreatedAfter': serialize.iso8601_datetime(date_created_after), 'DateCreatedBefore': serialize.iso8601_datetime(date_created_before), 'Track': track, 'Publisher': publisher, 'Kind': kind, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return SubscribedTrackPage(self._version, response, self._solution)
python
{ "resource": "" }
q29319
SubscribedTrackList.update
train
def update(self, track=values.unset, publisher=values.unset, kind=values.unset, status=values.unset): """ Update the SubscribedTrackInstance :param unicode track: The track :param unicode publisher: The publisher :param SubscribedTrackInstance.Kind kind: The kind :param SubscribedTrackInstance.Status status: The status :returns: Updated SubscribedTrackInstance :rtype: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackInstance """ data = values.of({'Track': track, 'Publisher': publisher, 'Kind': kind, 'Status': status, }) payload = self._version.update( 'POST', self._uri, data=data, ) return SubscribedTrackInstance( self._version, payload, room_sid=self._solution['room_sid'], subscriber_sid=self._solution['subscriber_sid'], )
python
{ "resource": "" }
q29320
SubscribedTrackPage.get_instance
train
def get_instance(self, payload): """ Build an instance of SubscribedTrackInstance :param dict payload: Payload response from the API :returns: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackInstance :rtype: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackInstance """ return SubscribedTrackInstance( self._version, payload, room_sid=self._solution['room_sid'], subscriber_sid=self._solution['subscriber_sid'], )
python
{ "resource": "" }
q29321
EventList.get
train
def get(self, sid): """ Constructs a EventContext :param sid: The sid :returns: twilio.rest.taskrouter.v1.workspace.event.EventContext :rtype: twilio.rest.taskrouter.v1.workspace.event.EventContext """ return EventContext(self._version, workspace_sid=self._solution['workspace_sid'], sid=sid, )
python
{ "resource": "" }
q29322
EventPage.get_instance
train
def get_instance(self, payload): """ Build an instance of EventInstance :param dict payload: Payload response from the API :returns: twilio.rest.taskrouter.v1.workspace.event.EventInstance :rtype: twilio.rest.taskrouter.v1.workspace.event.EventInstance """ return EventInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], )
python
{ "resource": "" }
q29323
TerminatingSipDomainList.create
train
def create(self, sip_domain_sid): """ Create a new TerminatingSipDomainInstance :param unicode sip_domain_sid: The SID of the SIP Domain to associate with the trunk :returns: Newly created TerminatingSipDomainInstance :rtype: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainInstance """ data = values.of({'SipDomainSid': sip_domain_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return TerminatingSipDomainInstance(self._version, payload, trunk_sid=self._solution['trunk_sid'], )
python
{ "resource": "" }
q29324
TerminatingSipDomainList.get
train
def get(self, sid): """ Constructs a TerminatingSipDomainContext :param sid: The unique string that identifies the resource :returns: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainContext :rtype: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainContext """ return TerminatingSipDomainContext(self._version, trunk_sid=self._solution['trunk_sid'], sid=sid, )
python
{ "resource": "" }
q29325
TerminatingSipDomainPage.get_instance
train
def get_instance(self, payload): """ Build an instance of TerminatingSipDomainInstance :param dict payload: Payload response from the API :returns: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainInstance :rtype: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainInstance """ return TerminatingSipDomainInstance(self._version, payload, trunk_sid=self._solution['trunk_sid'], )
python
{ "resource": "" }
q29326
AssistantInitiationActionsPage.get_instance
train
def get_instance(self, payload): """ Build an instance of AssistantInitiationActionsInstance :param dict payload: Payload response from the API :returns: twilio.rest.preview.understand.assistant.assistant_initiation_actions.AssistantInitiationActionsInstance :rtype: twilio.rest.preview.understand.assistant.assistant_initiation_actions.AssistantInitiationActionsInstance """ return AssistantInitiationActionsInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], )
python
{ "resource": "" }
q29327
IncomingPhoneNumberList.create
train
def create(self, api_version=values.unset, friendly_name=values.unset, sms_application_sid=values.unset, sms_fallback_method=values.unset, sms_fallback_url=values.unset, sms_method=values.unset, sms_url=values.unset, status_callback=values.unset, status_callback_method=values.unset, voice_application_sid=values.unset, voice_caller_id_lookup=values.unset, voice_fallback_method=values.unset, voice_fallback_url=values.unset, voice_method=values.unset, voice_url=values.unset, emergency_status=values.unset, emergency_address_sid=values.unset, trunk_sid=values.unset, identity_sid=values.unset, address_sid=values.unset, voice_receive_mode=values.unset, phone_number=values.unset, area_code=values.unset): """ Create a new IncomingPhoneNumberInstance :param unicode api_version: The API version to use for incoming calls made to the new phone number :param unicode friendly_name: A string to describe the new phone number :param unicode sms_application_sid: The SID of the application to handle SMS messages :param unicode sms_fallback_method: HTTP method used with sms_fallback_url :param unicode sms_fallback_url: The URL we call when an error occurs while executing TwiML :param unicode sms_method: The HTTP method to use with sms url :param unicode sms_url: The URL we should call when the new phone number receives an incoming SMS message :param unicode status_callback: The URL we should call to send status information to your application :param unicode status_callback_method: HTTP method we should use to call status_callback :param unicode voice_application_sid: The SID of the application to handle the new phone number :param bool voice_caller_id_lookup: Whether to lookup the caller's name :param unicode voice_fallback_method: The HTTP method used with voice_fallback_url :param unicode voice_fallback_url: The URL we will call when an error occurs in TwiML :param unicode voice_method: The HTTP method used with the voice_url :param unicode voice_url: The URL we should call when the phone number receives a call :param IncomingPhoneNumberInstance.EmergencyStatus emergency_status: Status determining whether the new phone number is enabled for emergency calling :param unicode emergency_address_sid: The emergency address configuration to use for emergency calling :param unicode trunk_sid: SID of the trunk to handle calls to the new phone number :param unicode identity_sid: The SID of the Identity resource to associate with the new phone number :param unicode address_sid: The SID of the Address resource associated with the phone number :param IncomingPhoneNumberInstance.VoiceReceiveMode voice_receive_mode: Incoming call type: fax or voice :param unicode phone_number: The phone number to purchase in E.164 format :param unicode area_code: The desired area code for the new phone number :returns: Newly created IncomingPhoneNumberInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance """ data = values.of({ 'PhoneNumber': phone_number, 'AreaCode': area_code, 'ApiVersion': api_version, 'FriendlyName': friendly_name, 'SmsApplicationSid': sms_application_sid, 'SmsFallbackMethod': sms_fallback_method, 'SmsFallbackUrl': sms_fallback_url, 'SmsMethod': sms_method, 'SmsUrl': sms_url, 'StatusCallback': status_callback, 'StatusCallbackMethod': status_callback_method, 'VoiceApplicationSid': voice_application_sid, 'VoiceCallerIdLookup': voice_caller_id_lookup, 'VoiceFallbackMethod': voice_fallback_method, 'VoiceFallbackUrl': voice_fallback_url, 'VoiceMethod': voice_method, 'VoiceUrl': voice_url, 'EmergencyStatus': emergency_status, 'EmergencyAddressSid': emergency_address_sid, 'TrunkSid': trunk_sid, 'IdentitySid': identity_sid, 'AddressSid': address_sid, 'VoiceReceiveMode': voice_receive_mode, }) payload = self._version.create( 'POST', self._uri, data=data, ) return IncomingPhoneNumberInstance( self._version, payload, account_sid=self._solution['account_sid'], )
python
{ "resource": "" }
q29328
IncomingPhoneNumberList.mobile
train
def mobile(self): """ Access the mobile :returns: twilio.rest.api.v2010.account.incoming_phone_number.mobile.MobileList :rtype: twilio.rest.api.v2010.account.incoming_phone_number.mobile.MobileList """ if self._mobile is None: self._mobile = MobileList(self._version, account_sid=self._solution['account_sid'], ) return self._mobile
python
{ "resource": "" }
q29329
IncomingPhoneNumberList.toll_free
train
def toll_free(self): """ Access the toll_free :returns: twilio.rest.api.v2010.account.incoming_phone_number.toll_free.TollFreeList :rtype: twilio.rest.api.v2010.account.incoming_phone_number.toll_free.TollFreeList """ if self._toll_free is None: self._toll_free = TollFreeList(self._version, account_sid=self._solution['account_sid'], ) return self._toll_free
python
{ "resource": "" }
q29330
IncomingPhoneNumberList.get
train
def get(self, sid): """ Constructs a IncomingPhoneNumberContext :param sid: The unique string that identifies the resource :returns: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberContext :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberContext """ return IncomingPhoneNumberContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
python
{ "resource": "" }
q29331
IncomingPhoneNumberPage.get_instance
train
def get_instance(self, payload): """ Build an instance of IncomingPhoneNumberInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance """ return IncomingPhoneNumberInstance( self._version, payload, account_sid=self._solution['account_sid'], )
python
{ "resource": "" }
q29332
IncomingPhoneNumberContext.assigned_add_ons
train
def assigned_add_ons(self): """ Access the assigned_add_ons :returns: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnList :rtype: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.AssignedAddOnList """ if self._assigned_add_ons is None: self._assigned_add_ons = AssignedAddOnList( self._version, account_sid=self._solution['account_sid'], resource_sid=self._solution['sid'], ) return self._assigned_add_ons
python
{ "resource": "" }
q29333
IncomingPhoneNumberInstance.update
train
def update(self, account_sid=values.unset, api_version=values.unset, friendly_name=values.unset, sms_application_sid=values.unset, sms_fallback_method=values.unset, sms_fallback_url=values.unset, sms_method=values.unset, sms_url=values.unset, status_callback=values.unset, status_callback_method=values.unset, voice_application_sid=values.unset, voice_caller_id_lookup=values.unset, voice_fallback_method=values.unset, voice_fallback_url=values.unset, voice_method=values.unset, voice_url=values.unset, emergency_status=values.unset, emergency_address_sid=values.unset, trunk_sid=values.unset, voice_receive_mode=values.unset, identity_sid=values.unset, address_sid=values.unset): """ Update the IncomingPhoneNumberInstance :param unicode account_sid: The SID of the Account that created the resource to update :param unicode api_version: The API version to use for incoming calls made to the phone number :param unicode friendly_name: A string to describe the resource :param unicode sms_application_sid: Unique string that identifies the application :param unicode sms_fallback_method: HTTP method used with sms_fallback_url :param unicode sms_fallback_url: The URL we call when an error occurs while executing TwiML :param unicode sms_method: The HTTP method to use with sms_url :param unicode sms_url: The URL we should call when the phone number receives an incoming SMS message :param unicode status_callback: The URL we should call to send status information to your application :param unicode status_callback_method: The HTTP method we should use to call status_callback :param unicode voice_application_sid: The SID of the application to handle the phone number :param bool voice_caller_id_lookup: Whether to lookup the caller's name :param unicode voice_fallback_method: The HTTP method used with fallback_url :param unicode voice_fallback_url: The URL we will call when an error occurs in TwiML :param unicode voice_method: The HTTP method used with the voice_url :param unicode voice_url: The URL we should call when the phone number receives a call :param IncomingPhoneNumberInstance.EmergencyStatus emergency_status: Whether the phone number is enabled for emergency calling :param unicode emergency_address_sid: The emergency address configuration to use for emergency calling :param unicode trunk_sid: SID of the trunk to handle phone calls to the phone number :param IncomingPhoneNumberInstance.VoiceReceiveMode voice_receive_mode: Incoming call type: fax or voice :param unicode identity_sid: Unique string that identifies the identity associated with number :param unicode address_sid: The SID of the Address resource associated with the phone number :returns: Updated IncomingPhoneNumberInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.IncomingPhoneNumberInstance """ return self._proxy.update( account_sid=account_sid, api_version=api_version, friendly_name=friendly_name, sms_application_sid=sms_application_sid, sms_fallback_method=sms_fallback_method, sms_fallback_url=sms_fallback_url, sms_method=sms_method, sms_url=sms_url, status_callback=status_callback, status_callback_method=status_callback_method, voice_application_sid=voice_application_sid, voice_caller_id_lookup=voice_caller_id_lookup, voice_fallback_method=voice_fallback_method, voice_fallback_url=voice_fallback_url, voice_method=voice_method, voice_url=voice_url, emergency_status=emergency_status, emergency_address_sid=emergency_address_sid, trunk_sid=trunk_sid, voice_receive_mode=voice_receive_mode, identity_sid=identity_sid, address_sid=address_sid, )
python
{ "resource": "" }
q29334
AlphaSenderList.create
train
def create(self, alpha_sender): """ Create a new AlphaSenderInstance :param unicode alpha_sender: An Alphanumeric Sender ID string, up to 11 characters. :returns: Newly created AlphaSenderInstance :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance """ data = values.of({'AlphaSender': alpha_sender, }) payload = self._version.create( 'POST', self._uri, data=data, ) return AlphaSenderInstance(self._version, payload, service_sid=self._solution['service_sid'], )
python
{ "resource": "" }
q29335
AlphaSenderList.get
train
def get(self, sid): """ Constructs a AlphaSenderContext :param sid: The sid :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderContext """ return AlphaSenderContext(self._version, service_sid=self._solution['service_sid'], sid=sid, )
python
{ "resource": "" }
q29336
AlphaSenderPage.get_instance
train
def get_instance(self, payload): """ Build an instance of AlphaSenderInstance :param dict payload: Payload response from the API :returns: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance :rtype: twilio.rest.messaging.v1.service.alpha_sender.AlphaSenderInstance """ return AlphaSenderInstance(self._version, payload, service_sid=self._solution['service_sid'], )
python
{ "resource": "" }
q29337
FaxList.stream
train
def stream(self, from_=values.unset, to=values.unset, date_created_on_or_before=values.unset, date_created_after=values.unset, limit=None, page_size=None): """ Streams FaxInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param unicode from_: Retrieve only those faxes sent from this phone number :param unicode to: Retrieve only those faxes sent to this phone number :param datetime date_created_on_or_before: Retrieve only faxes created on or before this date :param datetime date_created_after: Retrieve only faxes created after this date :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.fax.v1.fax.FaxInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( from_=from_, to=to, date_created_on_or_before=date_created_on_or_before, date_created_after=date_created_after, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29338
FaxList.page
train
def page(self, from_=values.unset, to=values.unset, date_created_on_or_before=values.unset, date_created_after=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of FaxInstance records from the API. Request is executed immediately :param unicode from_: Retrieve only those faxes sent from this phone number :param unicode to: Retrieve only those faxes sent to this phone number :param datetime date_created_on_or_before: Retrieve only faxes created on or before this date :param datetime date_created_after: Retrieve only faxes created after this date :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of FaxInstance :rtype: twilio.rest.fax.v1.fax.FaxPage """ params = values.of({ 'From': from_, 'To': to, 'DateCreatedOnOrBefore': serialize.iso8601_datetime(date_created_on_or_before), 'DateCreatedAfter': serialize.iso8601_datetime(date_created_after), 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return FaxPage(self._version, response, self._solution)
python
{ "resource": "" }
q29339
FaxList.create
train
def create(self, to, media_url, quality=values.unset, status_callback=values.unset, from_=values.unset, sip_auth_username=values.unset, sip_auth_password=values.unset, store_media=values.unset, ttl=values.unset): """ Create a new FaxInstance :param unicode to: The phone number to receive the fax :param unicode media_url: The Twilio-hosted URL of the PDF that contains the fax :param FaxInstance.Quality quality: The quality of this fax :param unicode status_callback: The URL we should call to send status information to your application :param unicode from_: The number the fax was sent from :param unicode sip_auth_username: The username for SIP authentication :param unicode sip_auth_password: The password for SIP authentication :param bool store_media: Whether to store a copy of the sent media :param unicode ttl: How long in minutes to try to send the fax :returns: Newly created FaxInstance :rtype: twilio.rest.fax.v1.fax.FaxInstance """ data = values.of({ 'To': to, 'MediaUrl': media_url, 'Quality': quality, 'StatusCallback': status_callback, 'From': from_, 'SipAuthUsername': sip_auth_username, 'SipAuthPassword': sip_auth_password, 'StoreMedia': store_media, 'Ttl': ttl, }) payload = self._version.create( 'POST', self._uri, data=data, ) return FaxInstance(self._version, payload, )
python
{ "resource": "" }
q29340
FaxInstance.update
train
def update(self, status=values.unset): """ Update the FaxInstance :param FaxInstance.UpdateStatus status: The new status of the resource :returns: Updated FaxInstance :rtype: twilio.rest.fax.v1.fax.FaxInstance """ return self._proxy.update(status=status, )
python
{ "resource": "" }
q29341
ParticipantContext.message_interactions
train
def message_interactions(self): """ Access the message_interactions :returns: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionList :rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionList """ if self._message_interactions is None: self._message_interactions = MessageInteractionList( self._version, service_sid=self._solution['service_sid'], session_sid=self._solution['session_sid'], participant_sid=self._solution['sid'], ) return self._message_interactions
python
{ "resource": "" }
q29342
CredentialListContext.credentials
train
def credentials(self): """ Access the credentials :returns: twilio.rest.api.v2010.account.sip.credential_list.credential.CredentialList :rtype: twilio.rest.api.v2010.account.sip.credential_list.credential.CredentialList """ if self._credentials is None: self._credentials = CredentialList( self._version, account_sid=self._solution['account_sid'], credential_list_sid=self._solution['sid'], ) return self._credentials
python
{ "resource": "" }
q29343
YesterdayPage.get_instance
train
def get_instance(self, payload): """ Build an instance of YesterdayInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.usage.record.yesterday.YesterdayInstance :rtype: twilio.rest.api.v2010.account.usage.record.yesterday.YesterdayInstance """ return YesterdayInstance(self._version, payload, account_sid=self._solution['account_sid'], )
python
{ "resource": "" }
q29344
TrunkList.create
train
def create(self, friendly_name=values.unset, domain_name=values.unset, disaster_recovery_url=values.unset, disaster_recovery_method=values.unset, recording=values.unset, secure=values.unset, cnam_lookup_enabled=values.unset): """ Create a new TrunkInstance :param unicode friendly_name: A string to describe the resource :param unicode domain_name: The unique address you reserve on Twilio to which you route your SIP traffic :param unicode disaster_recovery_url: The HTTP URL that we should call if an error occurs while sending SIP traffic towards your configured Origination URL :param unicode disaster_recovery_method: The HTTP method we should use to call the disaster_recovery_url :param TrunkInstance.RecordingSetting recording: The recording settings for the trunk :param bool secure: Whether Secure Trunking is enabled for the trunk :param bool cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup should be enabled for the trunk :returns: Newly created TrunkInstance :rtype: twilio.rest.trunking.v1.trunk.TrunkInstance """ data = values.of({ 'FriendlyName': friendly_name, 'DomainName': domain_name, 'DisasterRecoveryUrl': disaster_recovery_url, 'DisasterRecoveryMethod': disaster_recovery_method, 'Recording': recording, 'Secure': secure, 'CnamLookupEnabled': cnam_lookup_enabled, }) payload = self._version.create( 'POST', self._uri, data=data, ) return TrunkInstance(self._version, payload, )
python
{ "resource": "" }
q29345
TrunkContext.origination_urls
train
def origination_urls(self): """ Access the origination_urls :returns: twilio.rest.trunking.v1.trunk.origination_url.OriginationUrlList :rtype: twilio.rest.trunking.v1.trunk.origination_url.OriginationUrlList """ if self._origination_urls is None: self._origination_urls = OriginationUrlList(self._version, trunk_sid=self._solution['sid'], ) return self._origination_urls
python
{ "resource": "" }
q29346
TrunkContext.credentials_lists
train
def credentials_lists(self): """ Access the credentials_lists :returns: twilio.rest.trunking.v1.trunk.credential_list.CredentialListList :rtype: twilio.rest.trunking.v1.trunk.credential_list.CredentialListList """ if self._credentials_lists is None: self._credentials_lists = CredentialListList(self._version, trunk_sid=self._solution['sid'], ) return self._credentials_lists
python
{ "resource": "" }
q29347
TrunkContext.terminating_sip_domains
train
def terminating_sip_domains(self): """ Access the terminating_sip_domains :returns: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainList :rtype: twilio.rest.trunking.v1.trunk.terminating_sip_domain.TerminatingSipDomainList """ if self._terminating_sip_domains is None: self._terminating_sip_domains = TerminatingSipDomainList( self._version, trunk_sid=self._solution['sid'], ) return self._terminating_sip_domains
python
{ "resource": "" }
q29348
TrunkInstance.update
train
def update(self, friendly_name=values.unset, domain_name=values.unset, disaster_recovery_url=values.unset, disaster_recovery_method=values.unset, recording=values.unset, secure=values.unset, cnam_lookup_enabled=values.unset): """ Update the TrunkInstance :param unicode friendly_name: A string to describe the resource :param unicode domain_name: The unique address you reserve on Twilio to which you route your SIP traffic :param unicode disaster_recovery_url: The HTTP URL that we should call if an error occurs while sending SIP traffic towards your configured Origination URL :param unicode disaster_recovery_method: The HTTP method we should use to call the disaster_recovery_url :param TrunkInstance.RecordingSetting recording: The recording settings for the trunk :param bool secure: Whether Secure Trunking is enabled for the trunk :param bool cnam_lookup_enabled: Whether Caller ID Name (CNAM) lookup should be enabled for the trunk :returns: Updated TrunkInstance :rtype: twilio.rest.trunking.v1.trunk.TrunkInstance """ return self._proxy.update( friendly_name=friendly_name, domain_name=domain_name, disaster_recovery_url=disaster_recovery_url, disaster_recovery_method=disaster_recovery_method, recording=recording, secure=secure, cnam_lookup_enabled=cnam_lookup_enabled, )
python
{ "resource": "" }
q29349
AwsList.create
train
def create(self, credentials, friendly_name=values.unset, account_sid=values.unset): """ Create a new AwsInstance :param unicode credentials: A string that contains the AWS access credentials in the format <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> :param unicode friendly_name: A string to describe the resource :param unicode account_sid: The Subaccount this Credential should be associated with. :returns: Newly created AwsInstance :rtype: twilio.rest.accounts.v1.credential.aws.AwsInstance """ data = values.of({ 'Credentials': credentials, 'FriendlyName': friendly_name, 'AccountSid': account_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return AwsInstance(self._version, payload, )
python
{ "resource": "" }
q29350
VoipList.stream
train
def stream(self, area_code=values.unset, contains=values.unset, sms_enabled=values.unset, mms_enabled=values.unset, voice_enabled=values.unset, exclude_all_address_required=values.unset, exclude_local_address_required=values.unset, exclude_foreign_address_required=values.unset, beta=values.unset, near_number=values.unset, near_lat_long=values.unset, distance=values.unset, in_postal_code=values.unset, in_region=values.unset, in_rate_center=values.unset, in_lata=values.unset, in_locality=values.unset, fax_enabled=values.unset, limit=None, page_size=None): """ Streams VoipInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param unicode area_code: The area code of the phone numbers to read :param unicode contains: The pattern on which to match phone numbers :param bool sms_enabled: Whether the phone numbers can receive text messages :param bool mms_enabled: Whether the phone numbers can receive MMS messages :param bool voice_enabled: Whether the phone numbers can receive calls. :param bool exclude_all_address_required: Whether to exclude phone numbers that require an Address :param bool exclude_local_address_required: Whether to exclude phone numbers that require a local address :param bool exclude_foreign_address_required: Whether to exclude phone numbers that require a foreign address :param bool beta: Whether to read phone numbers new to the Twilio platform :param unicode near_number: Given a phone number, find a geographically close number within distance miles. (US/Canada only) :param unicode near_lat_long: Given a latitude/longitude pair lat,long find geographically close numbers within distance miles. (US/Canada only) :param unicode distance: The search radius, in miles, for a near_ query. (US/Canada only) :param unicode in_postal_code: Limit results to a particular postal code. (US/Canada only) :param unicode in_region: Limit results to a particular region. (US/Canada only) :param unicode in_rate_center: Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) :param unicode in_lata: Limit results to a specific local access and transport area. (US/Canada only) :param unicode in_locality: Limit results to a particular locality :param bool fax_enabled: Whether the phone numbers can receive faxes :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.api.v2010.account.available_phone_number.voip.VoipInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( area_code=area_code, contains=contains, sms_enabled=sms_enabled, mms_enabled=mms_enabled, voice_enabled=voice_enabled, exclude_all_address_required=exclude_all_address_required, exclude_local_address_required=exclude_local_address_required, exclude_foreign_address_required=exclude_foreign_address_required, beta=beta, near_number=near_number, near_lat_long=near_lat_long, distance=distance, in_postal_code=in_postal_code, in_region=in_region, in_rate_center=in_rate_center, in_lata=in_lata, in_locality=in_locality, fax_enabled=fax_enabled, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29351
VoipPage.get_instance
train
def get_instance(self, payload): """ Build an instance of VoipInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.available_phone_number.voip.VoipInstance :rtype: twilio.rest.api.v2010.account.available_phone_number.voip.VoipInstance """ return VoipInstance( self._version, payload, account_sid=self._solution['account_sid'], country_code=self._solution['country_code'], )
python
{ "resource": "" }
q29352
TranscriptionList.get
train
def get(self, sid): """ Constructs a TranscriptionContext :param sid: The unique string that identifies the resource :returns: twilio.rest.api.v2010.account.transcription.TranscriptionContext :rtype: twilio.rest.api.v2010.account.transcription.TranscriptionContext """ return TranscriptionContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
python
{ "resource": "" }
q29353
SampleList.create
train
def create(self, language, tagged_text, source_channel=values.unset): """ Create a new SampleInstance :param unicode language: The ISO language-country string that specifies the language used for the new sample :param unicode tagged_text: The text example of how end users might express the task :param unicode source_channel: The communication channel from which the new sample was captured :returns: Newly created SampleInstance :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance """ data = values.of({'Language': language, 'TaggedText': tagged_text, 'SourceChannel': source_channel, }) payload = self._version.create( 'POST', self._uri, data=data, ) return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], )
python
{ "resource": "" }
q29354
SampleList.get
train
def get(self, sid): """ Constructs a SampleContext :param sid: The unique string that identifies the resource :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext """ return SampleContext( self._version, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=sid, )
python
{ "resource": "" }
q29355
SamplePage.get_instance
train
def get_instance(self, payload): """ Build an instance of SampleInstance :param dict payload: Payload response from the API :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance """ return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], )
python
{ "resource": "" }
q29356
SampleContext.fetch
train
def fetch(self): """ Fetch a SampleInstance :returns: Fetched SampleInstance :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance """ params = values.of({}) payload = self._version.fetch( 'GET', self._uri, params=params, ) return SampleInstance( self._version, payload, assistant_sid=self._solution['assistant_sid'], task_sid=self._solution['task_sid'], sid=self._solution['sid'], )
python
{ "resource": "" }
q29357
SampleInstance.update
train
def update(self, language=values.unset, tagged_text=values.unset, source_channel=values.unset): """ Update the SampleInstance :param unicode language: The ISO language-country string that specifies the language used for the sample :param unicode tagged_text: The text example of how end users might express the task :param unicode source_channel: The communication channel from which the sample was captured :returns: Updated SampleInstance :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance """ return self._proxy.update(language=language, tagged_text=tagged_text, source_channel=source_channel, )
python
{ "resource": "" }
q29358
UsageList.records
train
def records(self): """ Access the records :returns: twilio.rest.api.v2010.account.usage.record.RecordList :rtype: twilio.rest.api.v2010.account.usage.record.RecordList """ if self._records is None: self._records = RecordList(self._version, account_sid=self._solution['account_sid'], ) return self._records
python
{ "resource": "" }
q29359
UsageList.triggers
train
def triggers(self): """ Access the triggers :returns: twilio.rest.api.v2010.account.usage.trigger.TriggerList :rtype: twilio.rest.api.v2010.account.usage.trigger.TriggerList """ if self._triggers is None: self._triggers = TriggerList(self._version, account_sid=self._solution['account_sid'], ) return self._triggers
python
{ "resource": "" }
q29360
Version.exception
train
def exception(cls, method, uri, response, message): """ Wraps an exceptional response in a `TwilioRestException`. """ # noinspection PyBroadException try: error_payload = json.loads(response.text) if 'message' in error_payload: message = '{}: {}'.format(message, error_payload['message']) code = error_payload.get('code', response.status_code) return TwilioRestException(response.status_code, uri, message, code, method) except Exception: return TwilioRestException(response.status_code, uri, message, response.status_code, method)
python
{ "resource": "" }
q29361
Version.read_limits
train
def read_limits(self, limit=None, page_size=None): """ Takes a limit on the max number of records to read and a max page_size and calculates the max number of pages to read. :param int limit: Max number of records to read. :param int page_size: Max page size. :return dict: A dictionary of paging limits. """ page_limit = values.unset if limit is not None: if page_size is None: page_size = limit page_limit = int(ceil(limit / float(page_size))) return { 'limit': limit or values.unset, 'page_size': page_size or values.unset, 'page_limit': page_limit, }
python
{ "resource": "" }
q29362
Version.stream
train
def stream(self, page, limit=None, page_limit=None): """ Generates records one a time from a page, stopping at prescribed limits. :param Page page: The page to stream. :param int limit: The max number of records to read. :param int page_imit: The max number of pages to read. """ current_record = 1 current_page = 1 while page is not None: for record in page: yield record current_record += 1 if limit and limit is not values.unset and limit < current_record: return if page_limit and page_limit is not values.unset and page_limit < current_page: return page = page.next_page() current_page += 1
python
{ "resource": "" }
q29363
Version.create
train
def create(self, method, uri, params=None, data=None, headers=None, auth=None, timeout=None, allow_redirects=False): """ Create a resource instance. """ response = self.request( method, uri, params=params, data=data, headers=headers, auth=auth, timeout=timeout, allow_redirects=allow_redirects, ) if response.status_code < 200 or response.status_code >= 300: raise self.exception(method, uri, response, 'Unable to create record') return json.loads(response.text)
python
{ "resource": "" }
q29364
ConferenceList.stream
train
def stream(self, date_created_before=values.unset, date_created=values.unset, date_created_after=values.unset, date_updated_before=values.unset, date_updated=values.unset, date_updated_after=values.unset, friendly_name=values.unset, status=values.unset, limit=None, page_size=None): """ Streams ConferenceInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param date date_created_before: The `YYYY-MM-DD` value of the resources to read :param date date_created: The `YYYY-MM-DD` value of the resources to read :param date date_created_after: The `YYYY-MM-DD` value of the resources to read :param date date_updated_before: The `YYYY-MM-DD` value of the resources to read :param date date_updated: The `YYYY-MM-DD` value of the resources to read :param date date_updated_after: The `YYYY-MM-DD` value of the resources to read :param unicode friendly_name: The string that identifies the Conference resources to read :param ConferenceInstance.Status status: The status of the resources to read :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.api.v2010.account.conference.ConferenceInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( date_created_before=date_created_before, date_created=date_created, date_created_after=date_created_after, date_updated_before=date_updated_before, date_updated=date_updated, date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29365
ConferenceList.page
train
def page(self, date_created_before=values.unset, date_created=values.unset, date_created_after=values.unset, date_updated_before=values.unset, date_updated=values.unset, date_updated_after=values.unset, friendly_name=values.unset, status=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ConferenceInstance records from the API. Request is executed immediately :param date date_created_before: The `YYYY-MM-DD` value of the resources to read :param date date_created: The `YYYY-MM-DD` value of the resources to read :param date date_created_after: The `YYYY-MM-DD` value of the resources to read :param date date_updated_before: The `YYYY-MM-DD` value of the resources to read :param date date_updated: The `YYYY-MM-DD` value of the resources to read :param date date_updated_after: The `YYYY-MM-DD` value of the resources to read :param unicode friendly_name: The string that identifies the Conference resources to read :param ConferenceInstance.Status status: The status of the resources to read :param str page_token: PageToken provided by the API :param int page_number: Page Number, this value is simply for client state :param int page_size: Number of records to return, defaults to 50 :returns: Page of ConferenceInstance :rtype: twilio.rest.api.v2010.account.conference.ConferencePage """ params = values.of({ 'DateCreated<': serialize.iso8601_date(date_created_before), 'DateCreated': serialize.iso8601_date(date_created), 'DateCreated>': serialize.iso8601_date(date_created_after), 'DateUpdated<': serialize.iso8601_date(date_updated_before), 'DateUpdated': serialize.iso8601_date(date_updated), 'DateUpdated>': serialize.iso8601_date(date_updated_after), 'FriendlyName': friendly_name, 'Status': status, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return ConferencePage(self._version, response, self._solution)
python
{ "resource": "" }
q29366
ConferenceList.get
train
def get(self, sid): """ Constructs a ConferenceContext :param sid: The unique string that identifies this resource :returns: twilio.rest.api.v2010.account.conference.ConferenceContext :rtype: twilio.rest.api.v2010.account.conference.ConferenceContext """ return ConferenceContext(self._version, account_sid=self._solution['account_sid'], sid=sid, )
python
{ "resource": "" }
q29367
ConferencePage.get_instance
train
def get_instance(self, payload): """ Build an instance of ConferenceInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.conference.ConferenceInstance :rtype: twilio.rest.api.v2010.account.conference.ConferenceInstance """ return ConferenceInstance(self._version, payload, account_sid=self._solution['account_sid'], )
python
{ "resource": "" }
q29368
ParticipantContext.published_tracks
train
def published_tracks(self): """ Access the published_tracks :returns: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackList :rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackList """ if self._published_tracks is None: self._published_tracks = PublishedTrackList( self._version, room_sid=self._solution['room_sid'], participant_sid=self._solution['sid'], ) return self._published_tracks
python
{ "resource": "" }
q29369
ParticipantContext.subscribed_tracks
train
def subscribed_tracks(self): """ Access the subscribed_tracks :returns: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackList :rtype: twilio.rest.video.v1.room.room_participant.room_participant_subscribed_track.SubscribedTrackList """ if self._subscribed_tracks is None: self._subscribed_tracks = SubscribedTrackList( self._version, room_sid=self._solution['room_sid'], subscriber_sid=self._solution['sid'], ) return self._subscribed_tracks
python
{ "resource": "" }
q29370
AssistantList.create
train
def create(self, friendly_name=values.unset, log_queries=values.unset, unique_name=values.unset, callback_url=values.unset, callback_events=values.unset, style_sheet=values.unset, defaults=values.unset): """ Create a new AssistantInstance :param unicode friendly_name: A string to describe the new resource :param bool log_queries: Whether queries should be logged and kept after training :param unicode unique_name: An application-defined string that uniquely identifies the new resource :param unicode callback_url: Reserved :param unicode callback_events: Reserved :param dict style_sheet: A JSON string that defines the Assistant's style sheet :param dict defaults: A JSON object that defines the Assistant's default tasks for various scenarios :returns: Newly created AssistantInstance :rtype: twilio.rest.autopilot.v1.assistant.AssistantInstance """ data = values.of({ 'FriendlyName': friendly_name, 'LogQueries': log_queries, 'UniqueName': unique_name, 'CallbackUrl': callback_url, 'CallbackEvents': callback_events, 'StyleSheet': serialize.object(style_sheet), 'Defaults': serialize.object(defaults), }) payload = self._version.create( 'POST', self._uri, data=data, ) return AssistantInstance(self._version, payload, )
python
{ "resource": "" }
q29371
AssistantContext.field_types
train
def field_types(self): """ Access the field_types :returns: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList :rtype: twilio.rest.autopilot.v1.assistant.field_type.FieldTypeList """ if self._field_types is None: self._field_types = FieldTypeList(self._version, assistant_sid=self._solution['sid'], ) return self._field_types
python
{ "resource": "" }
q29372
AssistantContext.model_builds
train
def model_builds(self): """ Access the model_builds :returns: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildList :rtype: twilio.rest.autopilot.v1.assistant.model_build.ModelBuildList """ if self._model_builds is None: self._model_builds = ModelBuildList(self._version, assistant_sid=self._solution['sid'], ) return self._model_builds
python
{ "resource": "" }
q29373
AssistantContext.queries
train
def queries(self): """ Access the queries :returns: twilio.rest.autopilot.v1.assistant.query.QueryList :rtype: twilio.rest.autopilot.v1.assistant.query.QueryList """ if self._queries is None: self._queries = QueryList(self._version, assistant_sid=self._solution['sid'], ) return self._queries
python
{ "resource": "" }
q29374
AssistantContext.style_sheet
train
def style_sheet(self): """ Access the style_sheet :returns: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetList :rtype: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetList """ if self._style_sheet is None: self._style_sheet = StyleSheetList(self._version, assistant_sid=self._solution['sid'], ) return self._style_sheet
python
{ "resource": "" }
q29375
AssistantContext.defaults
train
def defaults(self): """ Access the defaults :returns: twilio.rest.autopilot.v1.assistant.defaults.DefaultsList :rtype: twilio.rest.autopilot.v1.assistant.defaults.DefaultsList """ if self._defaults is None: self._defaults = DefaultsList(self._version, assistant_sid=self._solution['sid'], ) return self._defaults
python
{ "resource": "" }
q29376
AssistantContext.dialogues
train
def dialogues(self): """ Access the dialogues :returns: twilio.rest.autopilot.v1.assistant.dialogue.DialogueList :rtype: twilio.rest.autopilot.v1.assistant.dialogue.DialogueList """ if self._dialogues is None: self._dialogues = DialogueList(self._version, assistant_sid=self._solution['sid'], ) return self._dialogues
python
{ "resource": "" }
q29377
FactorList.create
train
def create(self, binding, friendly_name, factor_type): """ Create a new FactorInstance :param unicode binding: A unique binding for this Factor :param unicode friendly_name: The friendly name of this Factor :param FactorInstance.FactorTypes factor_type: The Type of this Factor :returns: Newly created FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ data = values.of({'Binding': binding, 'FriendlyName': friendly_name, 'FactorType': factor_type, }) payload = self._version.create( 'POST', self._uri, data=data, ) return FactorInstance( self._version, payload, service_sid=self._solution['service_sid'], identity=self._solution['identity'], )
python
{ "resource": "" }
q29378
FactorList.get
train
def get(self, sid): """ Constructs a FactorContext :param sid: A string that uniquely identifies this Factor. :returns: twilio.rest.authy.v1.service.entity.factor.FactorContext :rtype: twilio.rest.authy.v1.service.entity.factor.FactorContext """ return FactorContext( self._version, service_sid=self._solution['service_sid'], identity=self._solution['identity'], sid=sid, )
python
{ "resource": "" }
q29379
FactorPage.get_instance
train
def get_instance(self, payload): """ Build an instance of FactorInstance :param dict payload: Payload response from the API :returns: twilio.rest.authy.v1.service.entity.factor.FactorInstance :rtype: twilio.rest.authy.v1.service.entity.factor.FactorInstance """ return FactorInstance( self._version, payload, service_sid=self._solution['service_sid'], identity=self._solution['identity'], )
python
{ "resource": "" }
q29380
FactorContext.challenges
train
def challenges(self): """ Access the challenges :returns: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeList :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeList """ if self._challenges is None: self._challenges = ChallengeList( self._version, service_sid=self._solution['service_sid'], identity=self._solution['identity'], factor_sid=self._solution['sid'], ) return self._challenges
python
{ "resource": "" }
q29381
CommandList.stream
train
def stream(self, device=values.unset, sim=values.unset, status=values.unset, direction=values.unset, limit=None, page_size=None): """ Streams CommandInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param unicode device: The device :param unicode sim: The sim :param unicode status: The status :param unicode direction: The direction :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.preview.wireless.command.CommandInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page( device=device, sim=sim, status=status, direction=direction, page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'], limits['page_limit'])
python
{ "resource": "" }
q29382
Client.request
train
def request(self, method, uri, params=None, data=None, headers=None, auth=None, timeout=None, allow_redirects=False): """ Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided :param str method: HTTP Method :param str uri: Fully qualified url :param dict[str, str] params: Query string parameters :param dict[str, str] data: POST body data :param dict[str, str] headers: HTTP Headers :param tuple(str, str) auth: Authentication :param int timeout: Timeout in seconds :param bool allow_redirects: Should the client follow redirects :returns: Response from the Twilio API :rtype: twilio.http.response.Response """ auth = auth or self.auth headers = headers or {} headers['User-Agent'] = 'twilio-python/{} (Python {})'.format( __version__, platform.python_version(), ) headers['X-Twilio-Client'] = 'python-{}'.format(__version__) headers['Accept-Charset'] = 'utf-8' if method == 'POST' and 'Content-Type' not in headers: headers['Content-Type'] = 'application/x-www-form-urlencoded' if 'Accept' not in headers: headers['Accept'] = 'application/json' if self.region: head, tail = uri.split('.', 1) if not tail.startswith(self.region): uri = '.'.join([head, self.region, tail]) return self.http_client.request( method, uri, params=params, data=data, headers=headers, auth=auth, timeout=timeout, allow_redirects=allow_redirects )
python
{ "resource": "" }
q29383
Client.accounts
train
def accounts(self): """ Access the Accounts Twilio Domain :returns: Accounts Twilio Domain :rtype: twilio.rest.accounts.Accounts """ if self._accounts is None: from twilio.rest.accounts import Accounts self._accounts = Accounts(self) return self._accounts
python
{ "resource": "" }
q29384
Client.api
train
def api(self): """ Access the Api Twilio Domain :returns: Api Twilio Domain :rtype: twilio.rest.api.Api """ if self._api is None: from twilio.rest.api import Api self._api = Api(self) return self._api
python
{ "resource": "" }
q29385
Client.authy
train
def authy(self): """ Access the Authy Twilio Domain :returns: Authy Twilio Domain :rtype: twilio.rest.authy.Authy """ if self._authy is None: from twilio.rest.authy import Authy self._authy = Authy(self) return self._authy
python
{ "resource": "" }
q29386
Client.autopilot
train
def autopilot(self): """ Access the Autopilot Twilio Domain :returns: Autopilot Twilio Domain :rtype: twilio.rest.autopilot.Autopilot """ if self._autopilot is None: from twilio.rest.autopilot import Autopilot self._autopilot = Autopilot(self) return self._autopilot
python
{ "resource": "" }
q29387
Client.chat
train
def chat(self): """ Access the Chat Twilio Domain :returns: Chat Twilio Domain :rtype: twilio.rest.chat.Chat """ if self._chat is None: from twilio.rest.chat import Chat self._chat = Chat(self) return self._chat
python
{ "resource": "" }
q29388
Client.fax
train
def fax(self): """ Access the Fax Twilio Domain :returns: Fax Twilio Domain :rtype: twilio.rest.fax.Fax """ if self._fax is None: from twilio.rest.fax import Fax self._fax = Fax(self) return self._fax
python
{ "resource": "" }
q29389
Client.flex_api
train
def flex_api(self): """ Access the FlexApi Twilio Domain :returns: FlexApi Twilio Domain :rtype: twilio.rest.flex_api.FlexApi """ if self._flex_api is None: from twilio.rest.flex_api import FlexApi self._flex_api = FlexApi(self) return self._flex_api
python
{ "resource": "" }
q29390
Client.insights
train
def insights(self): """ Access the Insights Twilio Domain :returns: Insights Twilio Domain :rtype: twilio.rest.insights.Insights """ if self._insights is None: from twilio.rest.insights import Insights self._insights = Insights(self) return self._insights
python
{ "resource": "" }
q29391
Client.ip_messaging
train
def ip_messaging(self): """ Access the IpMessaging Twilio Domain :returns: IpMessaging Twilio Domain :rtype: twilio.rest.ip_messaging.IpMessaging """ if self._ip_messaging is None: from twilio.rest.ip_messaging import IpMessaging self._ip_messaging = IpMessaging(self) return self._ip_messaging
python
{ "resource": "" }
q29392
Client.lookups
train
def lookups(self): """ Access the Lookups Twilio Domain :returns: Lookups Twilio Domain :rtype: twilio.rest.lookups.Lookups """ if self._lookups is None: from twilio.rest.lookups import Lookups self._lookups = Lookups(self) return self._lookups
python
{ "resource": "" }
q29393
Client.messaging
train
def messaging(self): """ Access the Messaging Twilio Domain :returns: Messaging Twilio Domain :rtype: twilio.rest.messaging.Messaging """ if self._messaging is None: from twilio.rest.messaging import Messaging self._messaging = Messaging(self) return self._messaging
python
{ "resource": "" }
q29394
Client.monitor
train
def monitor(self): """ Access the Monitor Twilio Domain :returns: Monitor Twilio Domain :rtype: twilio.rest.monitor.Monitor """ if self._monitor is None: from twilio.rest.monitor import Monitor self._monitor = Monitor(self) return self._monitor
python
{ "resource": "" }
q29395
Client.notify
train
def notify(self): """ Access the Notify Twilio Domain :returns: Notify Twilio Domain :rtype: twilio.rest.notify.Notify """ if self._notify is None: from twilio.rest.notify import Notify self._notify = Notify(self) return self._notify
python
{ "resource": "" }
q29396
Client.preview
train
def preview(self): """ Access the Preview Twilio Domain :returns: Preview Twilio Domain :rtype: twilio.rest.preview.Preview """ if self._preview is None: from twilio.rest.preview import Preview self._preview = Preview(self) return self._preview
python
{ "resource": "" }
q29397
Client.pricing
train
def pricing(self): """ Access the Pricing Twilio Domain :returns: Pricing Twilio Domain :rtype: twilio.rest.pricing.Pricing """ if self._pricing is None: from twilio.rest.pricing import Pricing self._pricing = Pricing(self) return self._pricing
python
{ "resource": "" }
q29398
Client.proxy
train
def proxy(self): """ Access the Proxy Twilio Domain :returns: Proxy Twilio Domain :rtype: twilio.rest.proxy.Proxy """ if self._proxy is None: from twilio.rest.proxy import Proxy self._proxy = Proxy(self) return self._proxy
python
{ "resource": "" }
q29399
Client.serverless
train
def serverless(self): """ Access the Serverless Twilio Domain :returns: Serverless Twilio Domain :rtype: twilio.rest.serverless.Serverless """ if self._serverless is None: from twilio.rest.serverless import Serverless self._serverless = Serverless(self) return self._serverless
python
{ "resource": "" }