Exemple #1
0
    def page(self, page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of UserChannelInstance 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 UserChannelInstance
        :rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelPage
        """
        params = values.of({'PageToken': page_token, 'Page': page_number, 'PageSize': page_size, })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return UserChannelPage(self._version, response, self._solution)
Exemple #2
0
    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'],
        )
    def fetch(self):
        """
        Fetch a WorkerChannelInstance

        :returns: Fetched WorkerChannelInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_channel.WorkerChannelInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return WorkerChannelInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            worker_sid=self._solution['worker_sid'],
            sid=self._solution['sid'],
        )
Exemple #4
0
    def create(self,
               friendly_name,
               aws_credentials_sid=values.unset,
               encryption_key_sid=values.unset,
               aws_s3_url=values.unset,
               aws_storage_enabled=values.unset,
               encryption_enabled=values.unset):
        """
        Create a new CompositionSettingsInstance

        :param unicode friendly_name: Friendly name of the configuration to be shown in the console
        :param unicode aws_credentials_sid: SID of the Stored Credential resource CRxx
        :param unicode encryption_key_sid: SID of the Public Key resource CRxx
        :param unicode aws_s3_url: Identity of the external location where the compositions should be stored. We only support DNS-compliant URLs like http://<my-bucket>.s3-<aws-region>.amazonaws.com/compositions, where compositions is the path where you want compositions to be stored.
        :param bool aws_storage_enabled: true|false When set to true, all Compositions will be written to the AwsS3Url specified above. When set to false, all Compositions will be stored in Twilio's cloud.
        :param bool encryption_enabled: true|false When set to true, all Compositions will be stored encrypted.

        :returns: Newly created CompositionSettingsInstance
        :rtype: twilio.rest.video.v1.composition_settings.CompositionSettingsInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'AwsCredentialsSid': aws_credentials_sid,
            'EncryptionKeySid': encryption_key_sid,
            'AwsS3Url': aws_s3_url,
            'AwsStorageEnabled': aws_storage_enabled,
            'EncryptionEnabled': encryption_enabled,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return CompositionSettingsInstance(
            self._version,
            payload,
        )
Exemple #5
0
    def fetch(self):
        """
        Fetch a MediaInstance

        :returns: Fetched MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return MediaInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            message_sid=self._solution['message_sid'],
            sid=self._solution['sid'],
        )
    def fetch(self):
        """
        Fetch a CredentialListMappingInstance

        :returns: Fetched CredentialListMappingInstance
        :rtype: twilio.rest.api.v2010.account.sip.domain.credential_list_mapping.CredentialListMappingInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return CredentialListMappingInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            domain_sid=self._solution['domain_sid'],
            sid=self._solution['sid'],
        )
Exemple #7
0
    def fetch(self):
        """
        Fetch a RecordingInstance

        :returns: Fetched RecordingInstance
        :rtype: twilio.rest.api.v2010.account.conference.recording.RecordingInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return RecordingInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            conference_sid=self._solution['conference_sid'],
            sid=self._solution['sid'],
        )
Exemple #8
0
    def fetch(self):
        """
        Fetch a UserChannelInstance

        :returns: Fetched UserChannelInstance
        :rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return UserChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            user_sid=self._solution['user_sid'],
            channel_sid=self._solution['channel_sid'],
        )
    def fetch(self):
        """
        Fetch a SyncListItemInstance

        :returns: Fetched SyncListItemInstance
        :rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return SyncListItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            list_sid=self._solution['list_sid'],
            index=self._solution['index'],
        )
Exemple #10
0
    def fetch(self):
        """
        Fetch a SyncMapPermissionInstance

        :returns: Fetched SyncMapPermissionInstance
        :rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return SyncMapPermissionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
            identity=self._solution['identity'],
        )
Exemple #11
0
    def fetch(self):
        """
        Fetch a InviteInstance

        :returns: Fetched InviteInstance
        :rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return InviteInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
            sid=self._solution['sid'],
        )
Exemple #12
0
    def fetch(self):
        """
        Fetch a NotificationInstance

        :returns: Fetched NotificationInstance
        :rtype: twilio.rest.api.v2010.account.call.notification.NotificationInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return NotificationInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            call_sid=self._solution['call_sid'],
            sid=self._solution['sid'],
        )
    def fetch(self):
        """
        Fetch a TranscriptionInstance

        :returns: Fetched TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.recording.transcription.TranscriptionInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return TranscriptionInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            recording_sid=self._solution['recording_sid'],
            sid=self._solution['sid'],
        )
Exemple #14
0
    def fetch(self):
        """
        Fetch a MemberInstance

        :returns: Fetched MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return MemberInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            queue_sid=self._solution['queue_sid'],
            call_sid=self._solution['call_sid'],
        )
Exemple #15
0
    def fetch(self):
        """
        Fetch a ParticipantInstance

        :returns: Fetched ParticipantInstance
        :rtype: twilio.rest.proxy.v1.service.session.participant.ParticipantInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return ParticipantInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            session_sid=self._solution['session_sid'],
            sid=self._solution['sid'],
        )
Exemple #16
0
    def fetch(self):
        """
        Fetch a ExecutionStepInstance

        :returns: Fetched ExecutionStepInstance
        :rtype: twilio.rest.studio.v1.flow.execution.execution_step.ExecutionStepInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return ExecutionStepInstance(
            self._version,
            payload,
            flow_sid=self._solution['flow_sid'],
            execution_sid=self._solution['execution_sid'],
            sid=self._solution['sid'],
        )
Exemple #17
0
    def fetch(self,
              minutes=values.unset,
              start_date=values.unset,
              end_date=values.unset,
              task_channel=values.unset,
              split_by_wait_time=values.unset):
        """
        Fetch a WorkflowStatisticsInstance

        :param unicode minutes: Filter cumulative statistics by up to 'x' minutes in the past.
        :param datetime start_date: Filter cumulative statistics by a start date.
        :param datetime end_date: Filter cumulative statistics by an end date.
        :param unicode task_channel: Filter real-time and cumulative statistics by TaskChannel.
        :param unicode split_by_wait_time: A comma separated values for viewing splits of tasks canceled and accepted above the given threshold in seconds.

        :returns: Fetched WorkflowStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workflow.workflow_statistics.WorkflowStatisticsInstance
        """
        params = values.of({
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'EndDate': serialize.iso8601_datetime(end_date),
            'TaskChannel': task_channel,
            'SplitByWaitTime': split_by_wait_time,
        })

        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,
               weight=values.unset,
               priority=values.unset,
               enabled=values.unset,
               friendly_name=values.unset,
               sip_url=values.unset):
        """
        Update the OriginationUrlInstance

        :param unicode weight: Weight is used to determine the share of load when more than one URI has the same priority.
        :param unicode priority: Priority ranks the importance of the URI.
        :param bool enabled: A boolean value indicating whether the URL is enabled or disabled.
        :param unicode friendly_name: A human readable descriptive text, up to 64 characters long.
        :param unicode sip_url: The SIP address you want Twilio to route your Origination calls to.

        :returns: Updated OriginationUrlInstance
        :rtype: twilio.rest.trunking.v1.trunk.origination_url.OriginationUrlInstance
        """
        data = values.of({
            'Weight': weight,
            'Priority': priority,
            'Enabled': enabled,
            'FriendlyName': friendly_name,
            'SipUrl': sip_url,
        })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return OriginationUrlInstance(
            self._version,
            payload,
            trunk_sid=self._solution['trunk_sid'],
            sid=self._solution['sid'],
        )
    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 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)
    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 DependentHostedNumberOrderInstance records from the API.
        Request is executed immediately

        :param DependentHostedNumberOrderInstance.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 DependentHostedNumberOrderInstance
        :rtype: twilio.rest.preview.hosted_numbers.authorization_document.dependent_hosted_number_order.DependentHostedNumberOrderPage
        """
        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 DependentHostedNumberOrderPage(self._version, response, self._solution)
Exemple #21
0
    def page(self, status=values.unset, iccid=values.unset, rate_plan=values.unset,
             e_id=values.unset, sim_registration_code=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of SimInstance records from the API.
        Request is executed immediately

        :param SimInstance.Status status: Only return Sims with this status.
        :param unicode iccid: Return Sims with this Iccid.
        :param unicode rate_plan: Only return Sims with this Rate Plan.
        :param unicode e_id: The e_id
        :param unicode sim_registration_code: The sim_registration_code
        :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 SimInstance
        :rtype: twilio.rest.wireless.v1.sim.SimPage
        """
        params = values.of({
            'Status': status,
            'Iccid': iccid,
            'RatePlan': rate_plan,
            'EId': e_id,
            'SimRegistrationCode': sim_registration_code,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return SimPage(self._version, response, self._solution)
    def update(self,
               friendly_name=values.unset,
               assignment_callback_url=values.unset,
               fallback_assignment_callback_url=values.unset,
               configuration=values.unset,
               task_reservation_timeout=values.unset):
        """
        Update the WorkflowInstance

        :param unicode friendly_name: A string representing a human readable name for this Workflow.
        :param unicode assignment_callback_url: A valid URL for the application that will process task assignment events.
        :param unicode fallback_assignment_callback_url: If the request to the AssignmentCallbackUrl fails, the assignment callback will be made to this URL.
        :param unicode configuration: JSON document configuring the rules for this Workflow.
        :param unicode task_reservation_timeout: An integer value controlling how long in seconds TaskRouter will wait for a confirmation response from your application after assigning a Task to a worker.

        :returns: Updated WorkflowInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workflow.WorkflowInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'AssignmentCallbackUrl': assignment_callback_url,
            'FallbackAssignmentCallbackUrl': fallback_assignment_callback_url,
            'Configuration': configuration,
            'TaskReservationTimeout': task_reservation_timeout,
        })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return WorkflowInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            sid=self._solution['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: twilio.rest.api.v2010.account.outgoing_caller_id.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 update(self, friendly_name=values.unset):
        """
        Update the ActivityInstance

        :param unicode friendly_name: A human-readable name for the Activity, such as 'on-call', 'break', 'email', etc.

        :returns: Updated ActivityInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.activity.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'],
        )
Exemple #25
0
    def update(self, friendly_name=values.unset):
        """
        Update the KeyInstance

        :param unicode friendly_name: A descriptive string for this resource, chosen by your application, up to 64 characters long.

        :returns: Updated KeyInstance
        :rtype: twilio.rest.api.v2010.account.key.KeyInstance
        """
        data = values.of({'FriendlyName': friendly_name, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return KeyInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            sid=self._solution['sid'],
        )
Exemple #26
0
    def update(self, ttl=values.unset):
        """
        Update the SyncListInstance

        :param unicode ttl: Time-to-live of this List in seconds, defaults to no expiration.

        :returns: Updated SyncListInstance
        :rtype: twilio.rest.sync.v1.service.sync_list.SyncListInstance
        """
        data = values.of({'Ttl': ttl, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return SyncListInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
    def update(self, is_reserved=values.unset):
        """
        Update the ShortCodeInstance

        :param bool is_reserved: Reserve for manual assignment to participants only.

        :returns: Updated ShortCodeInstance
        :rtype: twilio.rest.proxy.v1.service.short_code.ShortCodeInstance
        """
        data = values.of({'IsReserved': is_reserved, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return ShortCodeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
    def update(self, ttl=values.unset):
        """
        Update the SyncMapInstance

        :param unicode ttl: New time-to-live of this Map in seconds.

        :returns: Updated SyncMapInstance
        :rtype: twilio.rest.sync.v1.service.sync_map.SyncMapInstance
        """
        data = values.of({'Ttl': ttl, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return SyncMapInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
Exemple #29
0
    def create(self, friendly_name=values.unset):
        """
        Create a new FleetInstance

        :param unicode friendly_name: A human readable description for this Fleet.

        :returns: Newly created FleetInstance
        :rtype: twilio.rest.preview.deployed_devices.fleet.FleetInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
        })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return FleetInstance(
            self._version,
            payload,
        )
Exemple #30
0
    def fetch(self):
        """
        Fetch a MessageInteractionInstance

        :returns: Fetched MessageInteractionInstance
        :rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
        """
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return MessageInteractionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            session_sid=self._solution['session_sid'],
            participant_sid=self._solution['participant_sid'],
            sid=self._solution['sid'],
        )