def fetch(self, country_code=values.unset, type=values.unset): """ Fetch a PhoneNumberInstance :param unicode country_code: The country_code :param unicode type: The type :returns: Fetched PhoneNumberInstance :rtype: PhoneNumberInstance """ params = values.of({ 'CountryCode': country_code, 'Type': type, }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return PhoneNumberInstance( self._version, payload, phone_number=self._solution['phone_number'], )
def create(self, start_date, end_date, include_subaccounts=values.unset, status_callback=values.unset, status_callback_method=values.unset): """ Create a new FeedbackSummaryInstance :param date start_date: The start_date :param date end_date: The end_date :param bool include_subaccounts: The include_subaccounts :param unicode status_callback: The status_callback :param unicode status_callback_method: The status_callback_method :returns: Newly created FeedbackSummaryInstance :rtype: FeedbackSummaryInstance """ data = values.of({ 'StartDate': serialize.iso8601_date(start_date), 'EndDate': serialize.iso8601_date(end_date), 'IncludeSubaccounts': include_subaccounts, 'StatusCallback': status_callback, 'StatusCallbackMethod': status_callback_method, }) payload = self._version.create( 'POST', self._uri, data=data, ) return FeedbackSummaryInstance( self._version, payload, account_sid=self._solution['account_sid'], )
def update(self, body, attributes=values.unset): """ Update the MessageInstance :param unicode body: The body :param dict attributes: The attributes :returns: Updated MessageInstance :rtype: MessageInstance """ data = values.of({ 'Body': body, 'Attributes': attributes, }) payload = self._version.update( 'POST', self._uri, data=data, ) return MessageInstance( self._version, payload, service_sid=self._solution['service_sid'], channel_sid=self._solution['channel_sid'], sid=self._solution['sid'], )
def page(self, friendly_name=values.unset, available=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ActivityInstance records from the API. Request is executed immediately :param unicode friendly_name: The friendly_name :param unicode available: The available :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 ActivityInstance :rtype: Page """ params = values.of({ 'FriendlyName': friendly_name, 'Available': available, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return ActivityPage( self._version, response, workspace_sid=self._solution['workspace_sid'], )
def page(self, device=values.unset, status=values.unset, direction=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of CommandInstance records from the API. Request is executed immediately :param unicode device: The device :param unicode status: The status :param unicode direction: The direction :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 CommandInstance :rtype: Page """ params = values.of({ 'Device': device, 'Status': status, 'Direction': direction, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return CommandPage(self._version, response, self._solution)
def create(self, ip_access_control_list_sid): """ Create a new IpAccessControlListMappingInstance :param unicode ip_access_control_list_sid: The ip_access_control_list_sid :returns: Newly created IpAccessControlListMappingInstance :rtype: IpAccessControlListMappingInstance """ data = values.of({ 'IpAccessControlListSid': ip_access_control_list_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return IpAccessControlListMappingInstance( self._version, payload, account_sid=self._solution['account_sid'], domain_sid=self._solution['domain_sid'], )
def page(self, friendly_name=values.unset, short_code=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ShortCodeInstance records from the API. Request is executed immediately :param unicode friendly_name: Filter by friendly name :param unicode short_code: Filter by ShortCode :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 ShortCodeInstance :rtype: Page """ params = values.of({ 'FriendlyName': friendly_name, 'ShortCode': short_code, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return ShortCodePage(self._version, response, self._solution)
def update(self, attributes=values.unset, assignment_status=values.unset, reason=values.unset, priority=values.unset): """ Update the TaskInstance :param unicode attributes: The attributes :param task.status assignment_status: The assignment_status :param unicode reason: The reason :param unicode priority: The priority :returns: Updated TaskInstance :rtype: TaskInstance """ data = values.of({ 'Attributes': attributes, 'AssignmentStatus': assignment_status, 'Reason': reason, 'Priority': priority, }) payload = self._version.update( 'POST', self._uri, data=data, ) return TaskInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], sid=self._solution['sid'], )
def update(self, callback_method=values.unset, callback_url=values.unset, friendly_name=values.unset): """ Update the TriggerInstance :param unicode callback_method: HTTP method to use with callback_url :param unicode callback_url: URL Twilio will request when the trigger fires :param unicode friendly_name: A user-specified, human-readable name for the trigger. :returns: Updated TriggerInstance :rtype: TriggerInstance """ data = values.of({ 'CallbackMethod': callback_method, 'CallbackUrl': callback_url, 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return TriggerInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def create(self, friendly_name, unique_name, attributes=values.unset, type=values.unset): """ Create a new ChannelInstance :param unicode friendly_name: The friendly_name :param unicode unique_name: The unique_name :param unicode attributes: The attributes :param channel.channel_type type: The type :returns: Newly created ChannelInstance :rtype: ChannelInstance """ data = values.of({ 'FriendlyName': friendly_name, 'UniqueName': unique_name, 'Attributes': attributes, 'Type': type, }) payload = self._version.create( 'POST', self._uri, data=data, ) return ChannelInstance( self._version, payload, service_sid=self._solution['service_sid'], )
def create(self, attributes, workflow_sid, timeout=values.unset, priority=values.unset): """ Create a new TaskInstance :param unicode attributes: The attributes :param unicode workflow_sid: The workflow_sid :param unicode timeout: The timeout :param unicode priority: The priority :returns: Newly created TaskInstance :rtype: TaskInstance """ data = values.of({ 'Attributes': attributes, 'WorkflowSid': workflow_sid, 'Timeout': timeout, 'Priority': priority, }) payload = self._version.create( 'POST', self._uri, data=data, ) return TaskInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], )
def update(self, url, method): """ Update the MemberInstance :param unicode url: The url :param unicode method: The method :returns: Updated MemberInstance :rtype: MemberInstance """ data = values.of({ 'Url': url, 'Method': method, }) payload = self._version.update( 'POST', self._uri, data=data, ) return MemberInstance( self._version, payload, account_sid=self._solution['account_sid'], queue_sid=self._solution['queue_sid'], call_sid=self._solution['call_sid'], )
def update(self, friendly_name=values.unset, api_version=values.unset, voice_url=values.unset, voice_method=values.unset, voice_fallback_url=values.unset, voice_fallback_method=values.unset, status_callback=values.unset, status_callback_method=values.unset, voice_caller_id_lookup=values.unset, sms_url=values.unset, sms_method=values.unset, sms_fallback_url=values.unset, sms_fallback_method=values.unset, sms_status_callback=values.unset, message_status_callback=values.unset): """ Update the ApplicationInstance :param unicode friendly_name: Human readable description of this resource :param unicode api_version: The API version to use :param unicode voice_url: URL Twilio will make requests to when relieving a call :param unicode voice_method: HTTP method to use with the URL :param unicode voice_fallback_url: Fallback URL :param unicode voice_fallback_method: HTTP method to use with the fallback url :param unicode status_callback: URL to hit with status updates :param unicode status_callback_method: HTTP method to use with the status callback :param bool voice_caller_id_lookup: True or False :param unicode sms_url: URL Twilio will request when receiving an SMS :param unicode sms_method: HTTP method to use with sms_url :param unicode sms_fallback_url: Fallback URL if there's an error parsing TwiML :param unicode sms_fallback_method: HTTP method to use with sms_fallback_method :param unicode sms_status_callback: URL Twilio with request with status updates :param unicode message_status_callback: URL to make requests to with status updates :returns: Updated ApplicationInstance :rtype: ApplicationInstance """ data = values.of({ 'FriendlyName': friendly_name, 'ApiVersion': api_version, 'VoiceUrl': voice_url, 'VoiceMethod': voice_method, 'VoiceFallbackUrl': voice_fallback_url, 'VoiceFallbackMethod': voice_fallback_method, 'StatusCallback': status_callback, 'StatusCallbackMethod': status_callback_method, 'VoiceCallerIdLookup': voice_caller_id_lookup, 'SmsUrl': sms_url, 'SmsMethod': sms_method, 'SmsFallbackUrl': sms_fallback_url, 'SmsFallbackMethod': sms_fallback_method, 'SmsStatusCallback': sms_status_callback, 'MessageStatusCallback': message_status_callback, }) payload = self._version.update( 'POST', self._uri, data=data, ) return ApplicationInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def create(self, identity, role_sid=values.unset): """ Create a new MemberInstance :param unicode identity: The identity :param unicode role_sid: The role_sid :returns: Newly created MemberInstance :rtype: MemberInstance """ data = values.of({ 'Identity': identity, 'RoleSid': role_sid, }) payload = self._version.create( 'POST', self._uri, data=data, ) return MemberInstance( self._version, payload, service_sid=self._solution['service_sid'], channel_sid=self._solution['channel_sid'], )
def update(self, friendly_name=values.unset): """ Update the OutgoingCallerIdInstance :param unicode friendly_name: A human readable description of the caller ID :returns: Updated OutgoingCallerIdInstance :rtype: OutgoingCallerIdInstance """ data = values.of({ 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return OutgoingCallerIdInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def create(self, friendly_name, configuration, assignment_callback_url, fallback_assignment_callback_url=values.unset, task_reservation_timeout=values.unset): """ Create a new WorkflowInstance :param unicode friendly_name: The friendly_name :param unicode configuration: The configuration :param unicode assignment_callback_url: The assignment_callback_url :param unicode fallback_assignment_callback_url: The fallback_assignment_callback_url :param unicode task_reservation_timeout: The task_reservation_timeout :returns: Newly created WorkflowInstance :rtype: WorkflowInstance """ data = values.of({ 'FriendlyName': friendly_name, 'Configuration': configuration, 'AssignmentCallbackUrl': assignment_callback_url, 'FallbackAssignmentCallbackUrl': fallback_assignment_callback_url, 'TaskReservationTimeout': task_reservation_timeout, }) payload = self._version.create( 'POST', self._uri, data=data, ) return WorkflowInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], )
def update(self, activity_sid=values.unset, attributes=values.unset, friendly_name=values.unset): """ Update the WorkerInstance :param unicode activity_sid: The activity_sid :param unicode attributes: The attributes :param unicode friendly_name: The friendly_name :returns: Updated WorkerInstance :rtype: WorkerInstance """ data = values.of({ 'ActivitySid': activity_sid, 'Attributes': attributes, 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return WorkerInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], sid=self._solution['sid'], )
def create(self, friendly_name, ip_address): """ Create a new IpAddressInstance :param unicode friendly_name: The friendly_name :param unicode ip_address: The ip_address :returns: Newly created IpAddressInstance :rtype: IpAddressInstance """ data = values.of({ 'FriendlyName': friendly_name, 'IpAddress': ip_address, }) payload = self._version.create( 'POST', self._uri, data=data, ) return IpAddressInstance( self._version, payload, account_sid=self._solution['account_sid'], ip_access_control_list_sid=self. _solution['ip_access_control_list_sid'], )
def update(self, body=values.unset): """ Update the MessageInstance :param unicode body: The body :returns: Updated MessageInstance :rtype: MessageInstance """ data = values.of({ 'Body': body, }) payload = self._version.update( 'POST', self._uri, data=data, ) return MessageInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def create(self, friendly_name, available): """ Create a new ActivityInstance :param unicode friendly_name: The friendly_name :param bool available: The available :returns: Newly created ActivityInstance :rtype: ActivityInstance """ data = values.of({ 'FriendlyName': friendly_name, 'Available': available, }) payload = self._version.create( 'POST', self._uri, data=data, ) return ActivityInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], )
def fetch(self, country_code=values.unset, type=values.unset, add_ons=values.unset, add_ons_data=values.unset): """ Fetch a PhoneNumberInstance :param unicode country_code: The country_code :param unicode type: The type :param unicode add_ons: The add_ons :param dict add_ons_data: The add_ons_data :returns: Fetched PhoneNumberInstance :rtype: PhoneNumberInstance """ params = values.of({ 'CountryCode': country_code, 'Type': type, 'AddOns': add_ons, }) params.update( serialize.prefixed_collapsible_map(add_ons_data, 'AddOns')) payload = self._version.fetch( 'GET', self._uri, params=params, ) return PhoneNumberInstance( self._version, payload, phone_number=self._solution['phone_number'], )
def create(self, weight, priority, enabled, friendly_name, sip_url): """ Create a new OriginationUrlInstance :param unicode weight: The weight :param unicode priority: The priority :param bool enabled: The enabled :param unicode friendly_name: The friendly_name :param unicode sip_url: The sip_url :returns: Newly created OriginationUrlInstance :rtype: OriginationUrlInstance """ data = values.of({ 'Weight': weight, 'Priority': priority, 'Enabled': enabled, 'FriendlyName': friendly_name, 'SipUrl': sip_url, }) payload = self._version.create( 'POST', self._uri, data=data, ) return OriginationUrlInstance( self._version, payload, trunk_sid=self._solution['trunk_sid'], )
def create(self, quality_score, issue=values.unset): """ Create a new FeedbackInstance :param unicode quality_score: The quality_score :param feedback.issues issue: The issue :returns: Newly created FeedbackInstance :rtype: FeedbackInstance """ data = values.of({ 'QualityScore': quality_score, 'Issue': issue, }) payload = self._version.create( 'POST', self._uri, data=data, ) return FeedbackInstance( self._version, payload, account_sid=self._solution['account_sid'], call_sid=self._solution['call_sid'], )
def update(self, friendly_name=values.unset, certificate=values.unset, private_key=values.unset, sandbox=values.unset, api_key=values.unset): """ Update the CredentialInstance :param unicode friendly_name: The friendly_name :param unicode certificate: The certificate :param unicode private_key: The private_key :param bool sandbox: The sandbox :param unicode api_key: The api_key :returns: Updated CredentialInstance :rtype: CredentialInstance """ data = values.of({ 'FriendlyName': friendly_name, 'Certificate': certificate, 'PrivateKey': private_key, 'Sandbox': sandbox, 'ApiKey': api_key, }) payload = self._version.update( 'POST', self._uri, data=data, ) return CredentialInstance( self._version, payload, sid=self._solution['sid'], )
def update(self, quality_score, issue=values.unset): """ Update the FeedbackInstance :param unicode quality_score: An integer from 1 to 5 :param feedback.issues issue: Issues experienced during the call :returns: Updated FeedbackInstance :rtype: FeedbackInstance """ data = values.of({ 'QualityScore': quality_score, 'Issue': issue, }) payload = self._version.update( 'POST', self._uri, data=data, ) return FeedbackInstance( self._version, payload, account_sid=self._solution['account_sid'], call_sid=self._solution['call_sid'], )
def update(self, friendly_name): """ Update the IpAccessControlListInstance :param unicode friendly_name: A human readable description of this resource :returns: Updated IpAccessControlListInstance :rtype: IpAccessControlListInstance """ data = values.of({ 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return IpAccessControlListInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def create(self, friendly_name, type, certificate=values.unset, private_key=values.unset, sandbox=values.unset, api_key=values.unset): """ Create a new CredentialInstance :param unicode friendly_name: The friendly_name :param credential.push_service type: The type :param unicode certificate: The certificate :param unicode private_key: The private_key :param bool sandbox: The sandbox :param unicode api_key: The api_key :returns: Newly created CredentialInstance :rtype: CredentialInstance """ data = values.of({ 'FriendlyName': friendly_name, 'Type': type, 'Certificate': certificate, 'PrivateKey': private_key, 'Sandbox': sandbox, 'ApiKey': api_key, }) payload = self._version.create( 'POST', self._uri, data=data, ) return CredentialInstance( self._version, payload, )
def update(self, username, password): """ Update the CredentialInstance :param unicode username: The username :param unicode password: The password :returns: Updated CredentialInstance :rtype: CredentialInstance """ data = values.of({ 'Username': username, 'Password': password, }) payload = self._version.update( 'POST', self._uri, data=data, ) return CredentialInstance( self._version, payload, account_sid=self._solution['account_sid'], credential_list_sid=self._solution['credential_list_sid'], sid=self._solution['sid'], )
def update(self, default_activity_sid=values.unset, event_callback_url=values.unset, friendly_name=values.unset, timeout_activity_sid=values.unset): """ Update the WorkspaceInstance :param unicode default_activity_sid: The default_activity_sid :param unicode event_callback_url: The event_callback_url :param unicode friendly_name: The friendly_name :param unicode timeout_activity_sid: The timeout_activity_sid :returns: Updated WorkspaceInstance :rtype: WorkspaceInstance """ data = values.of({ 'DefaultActivitySid': default_activity_sid, 'EventCallbackUrl': event_callback_url, 'FriendlyName': friendly_name, 'TimeoutActivitySid': timeout_activity_sid, }) payload = self._version.update( 'POST', self._uri, data=data, ) return WorkspaceInstance( self._version, payload, sid=self._solution['sid'], )
def create(self, body, from_=values.unset): """ Create a new MessageInstance :param unicode body: The body :param unicode from_: The from :returns: Newly created MessageInstance :rtype: MessageInstance """ data = values.of({ 'Body': body, 'From': from_, }) payload = self._version.create( 'POST', self._uri, data=data, ) return MessageInstance( self._version, payload, service_sid=self._solution['service_sid'], channel_sid=self._solution['channel_sid'], )
def update(self, muted): """ Update the ParticipantInstance :param bool muted: Indicates if the participant should be muted :returns: Updated ParticipantInstance :rtype: ParticipantInstance """ data = values.of({ 'Muted': muted, }) payload = self._version.update( 'POST', self._uri, data=data, ) return ParticipantInstance( self._version, payload, account_sid=self._solution['account_sid'], conference_sid=self._solution['conference_sid'], call_sid=self._solution['call_sid'], )
def update(self, friendly_name): """ Update the CredentialListInstance :param unicode friendly_name: The friendly_name :returns: Updated CredentialListInstance :rtype: CredentialListInstance """ data = values.of({ 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return CredentialListInstance( self._version, payload, account_sid=self._solution['account_sid'], sid=self._solution['sid'], )
def fetch(self, minutes=values.unset, start_date=values.unset, end_date=values.unset): """ Fetch a WorkflowStatisticsInstance :param unicode minutes: The minutes :param datetime start_date: The start_date :param datetime end_date: The end_date :returns: Fetched WorkflowStatisticsInstance :rtype: WorkflowStatisticsInstance """ params = values.of({ 'Minutes': minutes, 'StartDate': serialize.iso8601_datetime(start_date), 'EndDate': serialize.iso8601_datetime(end_date), }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return WorkflowStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], workflow_sid=self._solution['workflow_sid'], )
def update(self, role_sid=values.unset, attributes=values.unset, friendly_name=values.unset): """ Update the UserInstance :param unicode role_sid: The role_sid :param dict attributes: The attributes :param unicode friendly_name: The friendly_name :returns: Updated UserInstance :rtype: UserInstance """ data = values.of({ 'RoleSid': role_sid, 'Attributes': attributes, 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return UserInstance( self._version, payload, service_sid=self._solution['service_sid'], sid=self._solution['sid'], )
def create(self, identity, role_sid=values.unset, attributes=values.unset, friendly_name=values.unset): """ Create a new UserInstance :param unicode identity: The identity :param unicode role_sid: The role_sid :param unicode attributes: The attributes :param unicode friendly_name: The friendly_name :returns: Newly created UserInstance :rtype: UserInstance """ data = values.of({ 'Identity': identity, 'RoleSid': role_sid, 'Attributes': attributes, 'FriendlyName': friendly_name, }) payload = self._version.create( 'POST', self._uri, data=data, ) return UserInstance( self._version, payload, service_sid=self._solution['service_sid'], )
def update(self, ip_address=values.unset, friendly_name=values.unset): """ Update the IpAddressInstance :param unicode ip_address: The ip_address :param unicode friendly_name: The friendly_name :returns: Updated IpAddressInstance :rtype: IpAddressInstance """ data = values.of({ 'IpAddress': ip_address, 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return IpAddressInstance( self._version, payload, account_sid=self._solution['account_sid'], ip_access_control_list_sid=self. _solution['ip_access_control_list_sid'], sid=self._solution['sid'], )
def page(self, date_created_before=values.unset, date_created=values.unset, date_created_after=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of RecordingInstance records from the API. Request is executed immediately :param date date_created_before: The date_created :param date date_created: The date_created :param date date_created_after: The date_created :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 RecordingInstance :rtype: Page """ params = values.of({ 'DateCreated<': serialize.iso8601_date(date_created_before), 'DateCreated': serialize.iso8601_date(date_created), 'DateCreated>': serialize.iso8601_date(date_created_after), 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return RecordingPage(self._version, response, self._solution)
def page(self, muted=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ParticipantInstance records from the API. Request is executed immediately :param bool muted: Filter by muted participants :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 ParticipantInstance :rtype: Page """ params = values.of({ 'Muted': muted, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return ParticipantPage( self._version, response, account_sid=self._solution['account_sid'], conference_sid=self._solution['conference_sid'], )
def update(self, friendly_name): """ Update the ActivityInstance :param unicode friendly_name: The friendly_name :returns: Updated ActivityInstance :rtype: ActivityInstance """ data = values.of({ 'FriendlyName': friendly_name, }) payload = self._version.update( 'POST', self._uri, data=data, ) return ActivityInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], sid=self._solution['sid'], )
def fetch(self, end_date=values.unset, friendly_name=values.unset, minutes=values.unset, start_date=values.unset): """ Fetch a TaskQueueStatisticsInstance :param datetime end_date: The end_date :param unicode friendly_name: The friendly_name :param unicode minutes: The minutes :param datetime start_date: The start_date :returns: Fetched TaskQueueStatisticsInstance :rtype: TaskQueueStatisticsInstance """ params = values.of({ 'EndDate': serialize.iso8601_datetime(end_date), 'FriendlyName': friendly_name, 'Minutes': minutes, 'StartDate': serialize.iso8601_datetime(start_date), }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return TaskQueueStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], task_queue_sid=self._solution['task_queue_sid'], )
def update(self, data): """ Update the DocumentInstance :param dict data: The data :returns: Updated DocumentInstance :rtype: DocumentInstance """ data = values.of({ 'Data': data, }) payload = self._version.update( 'POST', self._uri, data=data, ) return DocumentInstance( self._version, payload, service_sid=self._solution['service_sid'], sid=self._solution['sid'], )
def page(self, friendly_name=values.unset, short_code=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of ShortCodeInstance records from the API. Request is executed immediately :param unicode friendly_name: Filter by friendly name :param unicode short_code: Filter by ShortCode :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 ShortCodeInstance :rtype: Page """ params = values.of({ 'FriendlyName': friendly_name, 'ShortCode': short_code, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return ShortCodePage( self._version, response, account_sid=self._solution['account_sid'], )
def create(self, unique_name=values.unset, data=values.unset): """ Create a new DocumentInstance :param unicode unique_name: The unique_name :param dict data: The data :returns: Newly created DocumentInstance :rtype: DocumentInstance """ data = values.of({ 'UniqueName': unique_name, 'Data': data, }) payload = self._version.create( 'POST', self._uri, data=data, ) return DocumentInstance( self._version, payload, service_sid=self._solution['service_sid'], )
def create(self, type, friendly_name=values.unset, certificate=values.unset, private_key=values.unset, sandbox=values.unset, api_key=values.unset): """ Create a new CredentialInstance :param credential.push_service type: The type :param unicode friendly_name: The friendly_name :param unicode certificate: The certificate :param unicode private_key: The private_key :param bool sandbox: The sandbox :param unicode api_key: The api_key :returns: Newly created CredentialInstance :rtype: CredentialInstance """ data = values.of({ 'Type': type, 'FriendlyName': friendly_name, 'Certificate': certificate, 'PrivateKey': private_key, 'Sandbox': sandbox, 'ApiKey': api_key, }) payload = self._version.create( 'POST', self._uri, data=data, ) return CredentialInstance( self._version, payload, )
def page(self, friendly_name=values.unset, status=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of AccountInstance records from the API. Request is executed immediately :param unicode friendly_name: FriendlyName to filter on :param account.status status: Status to filter on :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 AccountInstance :rtype: Page """ params = values.of({ 'FriendlyName': friendly_name, 'Status': status, 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return AccountPage( self._version, response, )
def update(self, friendly_name=values.unset, status=values.unset): """ Update the AccountInstance :param unicode friendly_name: FriendlyName to update :param account.status status: Status to update the Account with :returns: Updated AccountInstance :rtype: AccountInstance """ data = values.of({ 'FriendlyName': friendly_name, 'Status': status, }) payload = self._version.update( 'POST', self._uri, data=data, ) return AccountInstance( self._version, payload, sid=self._solution['sid'], )
def create(self, device, command, callback_method=values.unset, callback_url=values.unset): """ Create a new CommandInstance :param unicode device: The device :param unicode command: The command :param unicode callback_method: The callback_method :param unicode callback_url: The callback_url :returns: Newly created CommandInstance :rtype: CommandInstance """ data = values.of({ 'Device': device, 'Command': command, 'CallbackMethod': callback_method, 'CallbackUrl': callback_url, }) payload = self._version.create( 'POST', self._uri, data=data, ) return CommandInstance( self._version, payload, )
def update(self, data): """ Update the SyncListItemInstance :param dict data: The data :returns: Updated SyncListItemInstance :rtype: SyncListItemInstance """ data = values.of({ 'Data': data, }) payload = self._version.update( 'POST', self._uri, data=data, ) return SyncListItemInstance( self._version, payload, service_sid=self._solution['service_sid'], list_sid=self._solution['list_sid'], index=self._solution['index'], )
def page(self, 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 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: Page """ params = values.of({ '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)
def create(self, data): """ Create a new SyncListItemInstance :param dict data: The data :returns: Newly created SyncListItemInstance :rtype: SyncListItemInstance """ data = values.of({ 'Data': data, }) payload = self._version.create( 'POST', self._uri, data=data, ) return SyncListItemInstance( self._version, payload, service_sid=self._solution['service_sid'], list_sid=self._solution['list_sid'], )
def create(self, friendly_name, event_callback_url=values.unset, template=values.unset): """ Create a new WorkspaceInstance :param unicode friendly_name: The friendly_name :param unicode event_callback_url: The event_callback_url :param unicode template: The template :returns: Newly created WorkspaceInstance :rtype: WorkspaceInstance """ data = values.of({ 'FriendlyName': friendly_name, 'EventCallbackUrl': event_callback_url, 'Template': template, }) payload = self._version.create( 'POST', self._uri, data=data, ) return WorkspaceInstance( self._version, payload, )
def page(self, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of CredentialInstance records from the API. Request is executed immediately :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 CredentialInstance :rtype: Page """ params = values.of({ 'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, }) response = self._version.page( 'GET', self._uri, params=params, ) return CredentialPage( self._version, response, account_sid=self._solution['account_sid'], credential_list_sid=self._solution['credential_list_sid'], )
def create(self, to, from_): """ Create a new ParticipantInstance :param unicode to: The to :param unicode from_: The from :returns: Newly created ParticipantInstance :rtype: ParticipantInstance """ data = values.of({ 'To': to, 'From': from_, }) payload = self._version.create( 'POST', self._uri, data=data, ) return ParticipantInstance( self._version, payload, conversation_sid=self._solution['conversation_sid'], )