def fetch(self, minutes=values.unset, start_date=values.unset,
              end_date=values.unset):
        """
        Fetch a WorkerStatisticsInstance

        :param unicode minutes: The minutes
        :param datetime start_date: The start_date
        :param datetime end_date: The end_date

        :returns: Fetched WorkerStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
        """
        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 WorkerStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            worker_sid=self._solution['worker_sid'],
        )
Пример #2
0
    def page(self, end=values.unset, start=values.unset, granularity=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of UsageRecordInstance records from the API.
        Request is executed immediately

        :param datetime end: Only include usage that has occurred on or before this date.
        :param datetime start: Only include usage that has occurred on or after this date.
        :param UsageRecordInstance.Granularity granularity: The time-based grouping that results are aggregated by.
        :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 UsageRecordInstance
        :rtype: twilio.rest.wireless.v1.sim.usage_record.UsageRecordPage
        """
        params = values.of({
            'End': serialize.iso8601_datetime(end),
            'Start': serialize.iso8601_datetime(start),
            'Granularity': granularity,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return UsageRecordPage(self._version, response, self._solution)
    def fetch(self, end_date=values.unset, minutes=values.unset,
              start_date=values.unset, task_channel=values.unset):
        """
        Fetch a WorkersCumulativeStatisticsInstance

        :param datetime end_date: Filter cumulative statistics by a end date.
        :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 unicode task_channel: Filter cumulative statistics by TaskChannel.

        :returns: Fetched WorkersCumulativeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_cumulative_statistics.WorkersCumulativeStatisticsInstance
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskChannel': task_channel,
        })

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

        return WorkersCumulativeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )
Пример #4
0
    def update(self, attributes=values.unset, date_created=values.unset,
               date_updated=values.unset):
        """
        Update the ParticipantInstance

        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.

        :returns: Updated ParticipantInstance
        :rtype: twilio.rest.messaging.v1.session.participant.ParticipantInstance
        """
        data = values.of({
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

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

        return ParticipantInstance(
            self._version,
            payload,
            session_sid=self._solution['session_sid'],
            sid=self._solution['sid'],
        )
Пример #5
0
    def create(self, messaging_service_sid, friendly_name=values.unset,
               attributes=values.unset, date_created=values.unset,
               date_updated=values.unset, created_by=values.unset):
        """
        Create a new SessionInstance

        :param unicode messaging_service_sid: The unique id of the SMS Service this session belongs to.
        :param unicode friendly_name: The human-readable name of this session.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode created_by: Identity of the session's creator.

        :returns: Newly created SessionInstance
        :rtype: twilio.rest.messaging.v1.session.SessionInstance
        """
        data = values.of({
            'MessagingServiceSid': messaging_service_sid,
            'FriendlyName': friendly_name,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return SessionInstance(self._version, payload, )
Пример #6
0
    def create(self, friendly_name=values.unset, unique_name=values.unset,
               attributes=values.unset, type=values.unset,
               date_created=values.unset, date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A string to describe the new resource
        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param ChannelInstance.ChannelType type: The visibility of the channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode created_by: The identity of the User that created the Channel

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'Attributes': attributes,
            'Type': type,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
    def page(self, end_date=values.unset, friendly_name=values.unset,
             minutes=values.unset, start_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of TaskQueuesStatisticsInstance records from the API.
        Request is executed immediately

        :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
        :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 TaskQueuesStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.task_queue.task_queues_statistics.TaskQueuesStatisticsPage
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'FriendlyName': friendly_name,
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return TaskQueuesStatisticsPage(self._version, response, self._solution)
Пример #8
0
    def page(self, end=values.unset, start=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of DataSessionInstance records from the API.
        Request is executed immediately

        :param datetime end: The end
        :param datetime start: The start
        :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 DataSessionInstance
        :rtype: twilio.rest.wireless.v1.sim.data_session.DataSessionPage
        """
        params = values.of({
            'End': serialize.iso8601_datetime(end),
            'Start': serialize.iso8601_datetime(start),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return DataSessionPage(self._version, response, self._solution)
Пример #9
0
    def page(self, date_created_from=values.unset, date_created_to=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of ExecutionInstance records from the API.
        Request is executed immediately

        :param datetime date_created_from: Only show Executions that started on or after this ISO8601 date-time.
        :param datetime date_created_to: Only show Executions that started before this this ISO8601 date-time.
        :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 ExecutionInstance
        :rtype: twilio.rest.studio.v1.flow.execution.ExecutionPage
        """
        params = values.of({
            'DateCreatedFrom': serialize.iso8601_datetime(date_created_from),
            'DateCreatedTo': serialize.iso8601_datetime(date_created_to),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return ExecutionPage(self._version, response, self._solution)
Пример #10
0
    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 MediaInstance records from the API.
        Request is executed immediately

        :param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
        :param datetime date_created: The `YYYY-MM-DD` value of the resources to read
        :param datetime date_created_after: The `YYYY-MM-DD` value 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 MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaPage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_datetime(date_created_before),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateCreated>': 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 MediaPage(self._version, response, self._solution)
Пример #11
0
    def fetch(self, end_date=values.unset, minutes=values.unset,
              start_date=values.unset, task_channel=values.unset,
              split_by_wait_time=values.unset):
        """
        Fetch a WorkspaceCumulativeStatisticsInstance

        :param datetime end_date: Filter cumulative statistics by an end date.
        :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 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 WorkspaceCumulativeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.workspace_cumulative_statistics.WorkspaceCumulativeStatisticsInstance
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskChannel': task_channel,
            'SplitByWaitTime': split_by_wait_time,
        })

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

        return WorkspaceCumulativeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )
Пример #12
0
    def create(self, friendly_name=values.unset, unique_name=values.unset,
               attributes=values.unset, type=values.unset,
               date_created=values.unset, date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A human-readable name for the Channel.
        :param unicode unique_name: A unique, addressable name for the Channel.
        :param unicode attributes: An optional metadata field you can use to store any data you wish.
        :param ChannelInstance.ChannelType type: The visibility of the channel - public or private.
        :param datetime date_created: The optional ISO8601 time specifying the datetime the Channel should be set as being created.
        :param datetime date_updated: The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated.
        :param unicode created_by: Optional field to specify the Identity of the User that created the Channel.

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'Attributes': attributes,
            'Type': type,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
Пример #13
0
    def create(self, author=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               body=values.unset):
        """
        Create a new MessageInstance

        :param unicode author: The identity of the message's author.
        :param unicode attributes: A string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode body: The contents of the message.

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.messaging.v1.session.message.MessageInstance
        """
        data = values.of({
            'Author': author,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'Body': body,
        })

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

        return MessageInstance(self._version, payload, session_sid=self._solution['session_sid'], )
Пример #14
0
    def create(self, attributes=values.unset, twilio_address=values.unset,
               date_created=values.unset, date_updated=values.unset,
               identity=values.unset, user_address=values.unset):
        """
        Create a new ParticipantInstance

        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param unicode twilio_address: The address of the Twilio phone number that the participant is in contact with.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode identity: A unique string identifier for the session participant as Chat User.
        :param unicode user_address: The address of the participant's device.

        :returns: Newly created ParticipantInstance
        :rtype: twilio.rest.messaging.v1.session.participant.ParticipantInstance
        """
        data = values.of({
            'Identity': identity,
            'UserAddress': user_address,
            'Attributes': attributes,
            'TwilioAddress': twilio_address,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

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

        return ParticipantInstance(self._version, payload, session_sid=self._solution['session_sid'], )
Пример #15
0
    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)
Пример #16
0
    def create(self,
               from_=values.unset,
               attributes=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               last_updated_by=values.unset,
               body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The Identity of the new message's author
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode last_updated_by: The Identity of the User who last updated the Message
        :param unicode body: The message to send to the channel
        :param unicode media_sid:  The Media Sid to be attached to the new Message

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From':
            from_,
            'Attributes':
            attributes,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy':
            last_updated_by,
            'Body':
            body,
            'MediaSid':
            media_sid,
        })

        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'],
        )
Пример #17
0
    def page(self,
             status=values.unset,
             source_sid=values.unset,
             grouping_sid=values.unset,
             date_created_after=values.unset,
             date_created_before=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 RecordingInstance.Status status: Only show Recordings with the given status.
        :param unicode source_sid: Only show the Recordings with the given source Sid.
        :param unicode grouping_sid: Only show Recordings that have this GroupingSid.
        :param datetime date_created_after: Only show Recordings that started on or after this ISO8601 date-time with timezone.
        :param datetime date_created_before: Only show Recordings that started before this ISO8601 date-time with timezone.
        :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: twilio.rest.video.v1.recording.RecordingPage
        """
        params = values.of({
            'Status':
            status,
            'SourceSid':
            source_sid,
            'GroupingSid':
            serialize.map(grouping_sid, lambda e: e),
            'DateCreatedAfter':
            serialize.iso8601_datetime(date_created_after),
            'DateCreatedBefore':
            serialize.iso8601_datetime(date_created_before),
            '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)
Пример #18
0
    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)
Пример #19
0
    def create(self,
               identity,
               role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               attributes=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: The `identity` value that identifies the new resource's User
        :param unicode role_sid: The SID of the Role to assign to the member
        :param unicode last_consumed_message_index: The index of the last Message in the Channel the Member has read
        :param datetime last_consumption_timestamp: The ISO 8601 based timestamp string representing the datetime of the last Message read event for the member within the Channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode attributes: A valid JSON string that contains application-specific data

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity':
            identity,
            'RoleSid':
            role_sid,
            'LastConsumedMessageIndex':
            last_consumed_message_index,
            'LastConsumptionTimestamp':
            serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'Attributes':
            attributes,
        })

        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'],
        )
Пример #20
0
    def create(self,
               from_=values.unset,
               attributes=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               last_updated_by=values.unset,
               body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The identity of the message's author. Defaults to system if not specified.
        :param unicode attributes: The attributes metadata field you can use to store any data you wish.
        :param datetime date_created: The ISO8601 time specifying the datetime the Message should be set as being created.
        :param datetime date_updated: The ISO8601 time specifying the datetime the Message should be set as having been last updated.
        :param unicode last_updated_by: Specify the Identity of the User that last updated the Message
        :param unicode body: The message body string.
        :param unicode media_sid:  The Media Sid to be attached to this Message.

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From':
            from_,
            'Attributes':
            attributes,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy':
            last_updated_by,
            'Body':
            body,
            'MediaSid':
            media_sid,
        })

        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'],
        )
Пример #21
0
    def page(self,
             date_created_before=values.unset,
             date_created=values.unset,
             date_created_after=values.unset,
             call_sid=values.unset,
             conference_sid=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 datetime date_created_before: Only include recordings that were created on this date
        :param datetime date_created: Only include recordings that were created on this date
        :param datetime date_created_after: Only include recordings that were created on this date
        :param unicode call_sid: The Call SID of the resources to read
        :param unicode conference_sid: Read by unique Conference SID for the recording
        :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: twilio.rest.api.v2010.account.recording.RecordingPage
        """
        data = values.of({
            'DateCreated<':
            serialize.iso8601_datetime(date_created_before),
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateCreated>':
            serialize.iso8601_datetime(date_created_after),
            'CallSid':
            call_sid,
            'ConferenceSid':
            conference_sid,
            'PageToken':
            page_token,
            'Page':
            page_number,
            'PageSize':
            page_size,
        })

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

        return RecordingPage(self._version, response, self._solution)
Пример #22
0
    def update(self,
               author=values.unset,
               body=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               attributes=values.unset,
               x_twilio_webhook_enabled=values.unset):
        """
        Update the MessageInstance

        :param unicode author: The channel specific identifier of the message's author.
        :param unicode body: The content of the message.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode attributes: A string metadata field you can use to store any data you wish.
        :param MessageInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header

        :returns: The updated MessageInstance
        :rtype: twilio.rest.conversations.v1.service.conversation.message.MessageInstance
        """
        data = values.of({
            'Author':
            author,
            'Body':
            body,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'Attributes':
            attributes,
        })
        headers = values.of({
            'X-Twilio-Webhook-Enabled':
            x_twilio_webhook_enabled,
        })

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

        return MessageInstance(
            self._version,
            payload,
            chat_service_sid=self._solution['chat_service_sid'],
            conversation_sid=self._solution['conversation_sid'],
            sid=self._solution['sid'],
        )
Пример #23
0
    def page(self,
             room_type=values.unset,
             codec=values.unset,
             room_name=values.unset,
             created_after=values.unset,
             created_before=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RoomInstance records from the API.
        Request is executed immediately

        :param list[RoomInstance.RoomType] room_type: The room_type
        :param list[RoomInstance.Codec] codec: The codec
        :param unicode room_name: The room_name
        :param datetime created_after: The created_after
        :param datetime created_before: The created_before
        :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 RoomInstance
        :rtype: twilio.rest.insights.v1.room.RoomPage
        """
        data = values.of({
            'RoomType':
            serialize.map(room_type, lambda e: e),
            'Codec':
            serialize.map(codec, lambda e: e),
            'RoomName':
            room_name,
            'CreatedAfter':
            serialize.iso8601_datetime(created_after),
            'CreatedBefore':
            serialize.iso8601_datetime(created_before),
            'PageToken':
            page_token,
            'Page':
            page_number,
            'PageSize':
            page_size,
        })

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

        return RoomPage(self._version, response, self._solution)
Пример #24
0
    def create(self,
               from_=values.unset,
               attributes=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               last_updated_by=values.unset,
               body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The from
        :param unicode attributes: The attributes
        :param datetime date_created: The date_created
        :param datetime date_updated: The date_updated
        :param unicode last_updated_by: The last_updated_by
        :param unicode body: The body
        :param unicode media_sid: The media_sid

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From':
            from_,
            'Attributes':
            attributes,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy':
            last_updated_by,
            'Body':
            body,
            'MediaSid':
            media_sid,
        })

        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'],
        )
Пример #25
0
    def create(self,
               identity,
               role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               attributes=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: A unique string identifier for this User in this Service. See the access tokens docs for more details.
        :param unicode role_sid: The role to be assigned to this member. Defaults to the roles specified on the Service.
        :param unicode last_consumed_message_index: Field used to specify the last consumed Message index for the Channel for this Member.  Should only be used when recreating a Member from a backup/separate source.
        :param datetime last_consumption_timestamp: ISO8601 time indicating the last datetime the Member consumed a Message in the Channel.  Should only be used when recreating a Member from a backup/separate source
        :param datetime date_created: The ISO8601 time specifying the datetime the Members should be set as being created.  Will be set to the current time by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source
        :param datetime date_updated: The ISO8601 time specifying the datetime the Member should be set as having been last updated.  Will be set to the null by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source  and where a Member was previously updated.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity':
            identity,
            'RoleSid':
            role_sid,
            'LastConsumedMessageIndex':
            last_consumed_message_index,
            'LastConsumptionTimestamp':
            serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'Attributes':
            attributes,
        })

        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'],
        )
Пример #26
0
    def create(self,
               friendly_name=values.unset,
               unique_name=values.unset,
               attributes=values.unset,
               type=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A human-readable name for the Channel.
        :param unicode unique_name: A unique, addressable name for the Channel.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param ChannelInstance.ChannelType type: The visibility of the channel - public or private.
        :param datetime date_created: The optional ISO8601 time specifying the datetime the Channel should be set as being created.
        :param datetime date_updated: The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated.
        :param unicode created_by: Optional field to specify the Identity of the User that created the Channel.

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName':
            friendly_name,
            'UniqueName':
            unique_name,
            'Attributes':
            attributes,
            'Type':
            type,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'CreatedBy':
            created_by,
        })

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

        return ChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
        )
Пример #27
0
    def create(self,
               friendly_name=values.unset,
               unique_name=values.unset,
               attributes=values.unset,
               type=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A string to describe the new resource
        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param ChannelInstance.ChannelType type: The visibility of the channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode created_by: The identity of the User that created the Channel

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName':
            friendly_name,
            'UniqueName':
            unique_name,
            'Attributes':
            attributes,
            'Type':
            type,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'CreatedBy':
            created_by,
        })

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

        return ChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
        )
Пример #28
0
    def create(self,
               friendly_name=values.unset,
               unique_name=values.unset,
               attributes=values.unset,
               type=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               created_by=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 ChannelInstance.ChannelType type: The type
        :param datetime date_created: The date_created
        :param datetime date_updated: The date_updated
        :param unicode created_by: The created_by

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName':
            friendly_name,
            'UniqueName':
            unique_name,
            'Attributes':
            attributes,
            'Type':
            type,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'CreatedBy':
            created_by,
        })

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

        return ChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
        )
Пример #29
0
    def update(self,
               friendly_name=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               attributes=values.unset,
               messaging_service_sid=values.unset,
               x_twilio_webhook_enabled=values.unset):
        """
        Update the ConversationInstance

        :param unicode friendly_name: The human-readable name of this conversation.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param unicode messaging_service_sid: The unique id of the SMS Service this conversation belongs to.
        :param ConversationInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header

        :returns: The updated ConversationInstance
        :rtype: twilio.rest.conversations.v1.conversation.ConversationInstance
        """
        data = values.of({
            'FriendlyName':
            friendly_name,
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'Attributes':
            attributes,
            'MessagingServiceSid':
            messaging_service_sid,
        })
        headers = values.of({
            'X-Twilio-Webhook-Enabled':
            x_twilio_webhook_enabled,
        })

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

        return ConversationInstance(
            self._version,
            payload,
            sid=self._solution['sid'],
        )
Пример #30
0
    def update(self,
               role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset,
               date_created=values.unset,
               date_updated=values.unset,
               attributes=values.unset):
        """
        Update the MemberInstance

        :param unicode role_sid: The role to be assigned to this member.
        :param unicode last_consumed_message_index: Field used to specify the last consumed Message index for the Channel for this Member.
        :param datetime last_consumption_timestamp: ISO8601 time indicating the last datetime the Member consumed a Message in the Channel.
        :param datetime date_created: The ISO8601 time specifying the datetime the Members should be set as being created.
        :param datetime date_updated: The ISO8601 time specifying the datetime the Member should be set as having been last updated.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.

        :returns: Updated MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'RoleSid':
            role_sid,
            'LastConsumedMessageIndex':
            last_consumed_message_index,
            'LastConsumptionTimestamp':
            serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated':
            serialize.iso8601_datetime(date_created),
            'DateUpdated':
            serialize.iso8601_datetime(date_updated),
            'Attributes':
            attributes,
        })

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

        return MemberInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
            sid=self._solution['sid'],
        )
Пример #31
0
    def page(self, end_date=values.unset, event_type=values.unset,
             minutes=values.unset, reservation_sid=values.unset,
             start_date=values.unset, task_queue_sid=values.unset,
             task_sid=values.unset, worker_sid=values.unset,
             workflow_sid=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param datetime end_date: Filter events by an end date.
        :param unicode event_type: Filter events by those of a certain event type
        :param unicode minutes: Filter events by up to 'x' minutes in the past.
        :param unicode reservation_sid: Filter events by those pertaining to a particular reservation
        :param datetime start_date: Filter events by a start date.
        :param unicode task_queue_sid: Filter events by those pertaining to a particular queue
        :param unicode task_sid: Filter events by those pertaining to a particular task
        :param unicode worker_sid: Filter events by those pertaining to a particular worker
        :param unicode workflow_sid: The workflow_sid
        :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 EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventPage
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'EventType': event_type,
            'Minutes': minutes,
            'ReservationSid': reservation_sid,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskQueueSid': task_queue_sid,
            'TaskSid': task_sid,
            'WorkerSid': worker_sid,
            'WorkflowSid': workflow_sid,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return EventPage(self._version, response, self._solution)
Пример #32
0
    def create(self, expiration_date=values.unset, details=values.unset,
               hidden_details=values.unset):
        """
        Create a new ChallengeInstance

        :param datetime expiration_date: The future date in which this Challenge will expire
        :param unicode details: Public details provided to contextualize the Challenge
        :param unicode hidden_details: Hidden details provided to contextualize the Challenge

        :returns: Newly created ChallengeInstance
        :rtype: twilio.rest.authy.v1.service.entity.factor.challenge.ChallengeInstance
        """
        data = values.of({
            'ExpirationDate': serialize.iso8601_datetime(expiration_date),
            'Details': details,
            'HiddenDetails': hidden_details,
        })

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

        return ChallengeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            factor_sid=self._solution['factor_sid'],
        )
Пример #33
0
    def update(self, date_expiry=values.unset, ttl=values.unset, mode=values.unset,
               status=values.unset, participants=values.unset):
        """
        Update the SessionInstance

        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Mode mode: The Mode of the Session
        :param SessionInstance.Status status: The new status of the resource
        :param dict participants: The Participant objects to include in the session

        :returns: Updated SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
        })

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

        return SessionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
Пример #34
0
    def update(self,
               notification_level=values.unset,
               last_read_timestamp=values.unset,
               last_read_message_index=values.unset):
        """
        Update the UserConversationInstance

        :param UserConversationInstance.NotificationLevel notification_level: The Notification Level of this User Conversation.
        :param datetime last_read_timestamp: The date of the last message read in conversation by the user.
        :param unicode last_read_message_index: The index of the last read Message.

        :returns: The updated UserConversationInstance
        :rtype: twilio.rest.conversations.v1.user.user_conversation.UserConversationInstance
        """
        data = values.of({
            'NotificationLevel':
            notification_level,
            'LastReadTimestamp':
            serialize.iso8601_datetime(last_read_timestamp),
            'LastReadMessageIndex':
            last_read_message_index,
        })

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

        return UserConversationInstance(
            self._version,
            payload,
            user_sid=self._solution['user_sid'],
            conversation_sid=self._solution['conversation_sid'],
        )
Пример #35
0
    def update(self, notification_level=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset):
        """
        Update the UserChannelInstance

        :param UserChannelInstance.NotificationLevel notification_level: The push notification level to assign to the User Channel
        :param unicode last_consumed_message_index: The index of the last Message that the Member has read within the Channel
        :param datetime last_consumption_timestamp: The ISO 8601 based timestamp string that represents the datetime of the last Message read event for the Member within the Channel

        :returns: The updated UserChannelInstance
        :rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
        """
        data = values.of({
            'NotificationLevel': notification_level,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
        })

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

        return UserChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            user_sid=self._solution['user_sid'],
            channel_sid=self._solution['channel_sid'],
        )
Пример #36
0
    def update(self,
               date_expiry=values.unset,
               ttl=values.unset,
               status=values.unset):
        """
        Update the SessionInstance

        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Status status: The new status of the resource

        :returns: The updated SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Status': status,
        })

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

        return SessionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
Пример #37
0
    def create(self, unique_name=values.unset, date_expiry=values.unset,
               ttl=values.unset, mode=values.unset, status=values.unset,
               participants=values.unset):
        """
        Create a new SessionInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Mode mode: The Mode of the Session
        :param SessionInstance.Status status: Session status
        :param dict participants: The Participant objects to include in the new session

        :returns: Newly created SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
        })

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

        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
Пример #38
0
    def update(self, date_expiry=values.unset, ttl=values.unset,
               status=values.unset, fail_on_participant_conflict=values.unset):
        """
        Update the SessionInstance

        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Status status: The new status of the resource
        :param bool fail_on_participant_conflict: An experimental parameter to override the ProxyAllowParticipantConflict account flag on a per-request basis.

        :returns: The updated SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Status': status,
            'FailOnParticipantConflict': fail_on_participant_conflict,
        })

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

        return SessionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
Пример #39
0
    def create(self, unique_name=values.unset, date_expiry=values.unset,
               ttl=values.unset, mode=values.unset, status=values.unset,
               participants=values.unset):
        """
        Create a new SessionInstance

        :param unicode unique_name: A unique, developer assigned name of this Session.
        :param datetime date_expiry: The date this Session should expire
        :param unicode ttl: TTL for a Session, in seconds.
        :param SessionInstance.Mode mode: The Mode of this Session
        :param SessionInstance.Status status: Session status
        :param dict participants: The participants

        :returns: Newly created SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
        })

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

        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
Пример #40
0
    def create(self, factor_sid, expiration_date=values.unset,
               details_message=values.unset, details_fields=values.unset,
               hidden_details=values.unset, auth_payload=values.unset):
        """
        Create the ChallengeInstance

        :param unicode factor_sid: Factor Sid.
        :param datetime expiration_date: The date-time when this Challenge expires
        :param unicode details_message: Shown to the user when the push notification arrives
        :param list[dict] details_fields: A list of objects that describe the Fields included in the Challenge
        :param dict hidden_details: Hidden details provided to contextualize the Challenge
        :param unicode auth_payload: Optional payload to verify the Challenge

        :returns: The created ChallengeInstance
        :rtype: twilio.rest.verify.v2.service.entity.challenge.ChallengeInstance
        """
        data = values.of({
            'FactorSid': factor_sid,
            'ExpirationDate': serialize.iso8601_datetime(expiration_date),
            'Details.Message': details_message,
            'Details.Fields': serialize.map(details_fields, lambda e: serialize.object(e)),
            'HiddenDetails': serialize.object(hidden_details),
            'AuthPayload': auth_payload,
        })

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

        return ChallengeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
        )
Пример #41
0
    def create(self, unique_name=values.unset, date_expiry=values.unset,
               ttl=values.unset, mode=values.unset, status=values.unset,
               participants=values.unset,
               fail_on_participant_conflict=values.unset):
        """
        Create the SessionInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Mode mode: The Mode of the Session
        :param SessionInstance.Status status: Session status
        :param dict participants: The Participant objects to include in the new session
        :param bool fail_on_participant_conflict: An experimental flag that instructs Proxy to reject a Session create request when it detects a Participant conflict.

        :returns: The created SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
            'FailOnParticipantConflict': fail_on_participant_conflict,
        })

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

        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
Пример #42
0
    def update(self, notification_level=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset):
        """
        Update the UserChannelInstance

        :param UserChannelInstance.NotificationLevel notification_level: The notification_level
        :param unicode last_consumed_message_index: The last_consumed_message_index
        :param datetime last_consumption_timestamp: The last_consumption_timestamp

        :returns: The updated UserChannelInstance
        :rtype: twilio.rest.ip_messaging.v2.service.user.user_channel.UserChannelInstance
        """
        data = values.of({
            'NotificationLevel': notification_level,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
        })

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

        return UserChannelInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            user_sid=self._solution['user_sid'],
            channel_sid=self._solution['channel_sid'],
        )
Пример #43
0
    def update(self, date_expiry=values.unset, ttl=values.unset,
               status=values.unset, fail_on_participant_conflict=values.unset):
        """
        Update the SessionInstance

        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Status status: The new status of the resource
        :param bool fail_on_participant_conflict: An experimental flag that instructs Proxy to return 400 instead of 200 when it detects that conflicts would result from re-open requests.

        :returns: The updated SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Status': status,
            'FailOnParticipantConflict': fail_on_participant_conflict,
        })

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

        return SessionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
Пример #44
0
    def create(self, expiration_date=values.unset, details=values.unset,
               hidden_details=values.unset, twilio_sandbox_mode=values.unset):
        """
        Create the ChallengeInstance

        :param datetime expiration_date: The future date in which this Challenge will expire
        :param unicode details: Public details provided to contextualize the Challenge
        :param unicode hidden_details: Hidden details provided to contextualize the Challenge
        :param unicode twilio_sandbox_mode: The Twilio-Sandbox-Mode HTTP request header

        :returns: The created ChallengeInstance
        :rtype: twilio.rest.verify.v2.service.entity.factor.challenge.ChallengeInstance
        """
        data = values.of({
            'ExpirationDate': serialize.iso8601_datetime(expiration_date),
            'Details': details,
            'HiddenDetails': hidden_details,
        })
        headers = values.of({'Twilio-Sandbox-Mode': twilio_sandbox_mode, })

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

        return ChallengeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            factor_sid=self._solution['factor_sid'],
        )
Пример #45
0
    def page(self,
             status=values.unset,
             unique_name=values.unset,
             date_created_after=values.unset,
             date_created_before=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RoomInstance records from the API.
        Request is executed immediately

        :param RoomInstance.RoomStatus status: Read only the rooms with this status
        :param unicode unique_name: Read only rooms with this unique_name
        :param datetime date_created_after: Read only rooms that started on or after this date, given as YYYY-MM-DD
        :param datetime date_created_before: Read only rooms that started before this date, given as YYYY-MM-DD
        :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 RoomInstance
        :rtype: twilio.rest.video.v1.room.RoomPage
        """
        data = values.of({
            'Status':
            status,
            'UniqueName':
            unique_name,
            'DateCreatedAfter':
            serialize.iso8601_datetime(date_created_after),
            'DateCreatedBefore':
            serialize.iso8601_datetime(date_created_before),
            'PageToken':
            page_token,
            'Page':
            page_number,
            'PageSize':
            page_size,
        })

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

        return RoomPage(self._version, response, self._solution)
Пример #46
0
    def page(self, status=values.unset, source_sid=values.unset,
             grouping_sid=values.unset, date_created_after=values.unset,
             date_created_before=values.unset, media_type=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 RecordingInstance.Status status: Only show Recordings with the given status.
        :param unicode source_sid: Only show the Recordings with the given source Sid.
        :param unicode grouping_sid: Only show Recordings that have this GroupingSid.
        :param datetime date_created_after: Only show Recordings that started on or after this ISO8601 date-time with timezone.
        :param datetime date_created_before: Only show Recordings that started before this ISO8601 date-time with timezone.
        :param RecordingInstance.Type media_type: Only show Recordings that have this media type.
        :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: twilio.rest.video.v1.recording.RecordingPage
        """
        params = values.of({
            'Status': status,
            'SourceSid': source_sid,
            'GroupingSid': serialize.map(grouping_sid, lambda e: e),
            'DateCreatedAfter': serialize.iso8601_datetime(date_created_after),
            'DateCreatedBefore': serialize.iso8601_datetime(date_created_before),
            'MediaType': media_type,
            '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)
Пример #47
0
    def page(self, end_date=values.unset, friendly_name=values.unset,
             minutes=values.unset, start_date=values.unset,
             task_channel=values.unset, split_by_wait_time=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of TaskQueuesStatisticsInstance records from the API.
        Request is executed immediately

        :param datetime end_date: Filter cumulative statistics by an end date.
        :param unicode friendly_name: Filter the TaskQueue stats based on a TaskQueue’s name
        :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 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.
        :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 TaskQueuesStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.task_queue.task_queues_statistics.TaskQueuesStatisticsPage
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'FriendlyName': friendly_name,
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskChannel': task_channel,
            'SplitByWaitTime': split_by_wait_time,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return TaskQueuesStatisticsPage(self._version, response, self._solution)
Пример #48
0
    def page(self, actor_sid=values.unset, event_type=values.unset,
             resource_sid=values.unset, source_ip_address=values.unset,
             start_date=values.unset, end_date=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param unicode actor_sid: Only include Events initiated by this Actor
        :param unicode event_type: Only include Events of this EventType
        :param unicode resource_sid: Only include Events referring to this resource
        :param unicode source_ip_address: Only include Events that originated from this IP address
        :param datetime start_date: Only show events on or after this date
        :param datetime end_date: Only show events on or before 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 EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventPage
        """
        params = values.of({
            'ActorSid': actor_sid,
            'EventType': event_type,
            'ResourceSid': resource_sid,
            'SourceIpAddress': source_ip_address,
            'StartDate': serialize.iso8601_datetime(start_date),
            'EndDate': serialize.iso8601_datetime(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return EventPage(self._version, response, self._solution)
Пример #49
0
    def create(self, identity, role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset, date_created=values.unset,
               date_updated=values.unset, attributes=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: The `identity` value that identifies the new resource's User
        :param unicode role_sid: The SID of the Role to assign to the member
        :param unicode last_consumed_message_index: The index of the last Message in the Channel the Member has read
        :param datetime last_consumption_timestamp: The ISO 8601 based timestamp string representing the date-time of the last Message read event for the Member within the Channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode attributes: A valid JSON string that contains application-specific data

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity': identity,
            'RoleSid': role_sid,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'Attributes': attributes,
        })

        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'],
        )
Пример #50
0
    def create(self, from_=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               last_updated_by=values.unset, body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The identity of the message's author. Defaults to system if not specified.
        :param unicode attributes: The attributes metadata field you can use to store any data you wish.
        :param datetime date_created: The ISO8601 time specifying the datetime the Message should be set as being created.
        :param datetime date_updated: The ISO8601 time specifying the datetime the Message should be set as having been last updated.
        :param unicode last_updated_by: Specify the Identity of the User that last updated the Message
        :param unicode body: The message body string.
        :param unicode media_sid:  The Media Sid to be attached to this Message.

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From': from_,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy': last_updated_by,
            'Body': body,
            'MediaSid': media_sid,
        })

        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'],
        )
Пример #51
0
    def create(self, from_=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               last_updated_by=values.unset, body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The from
        :param unicode attributes: The attributes
        :param datetime date_created: The date_created
        :param datetime date_updated: The date_updated
        :param unicode last_updated_by: The last_updated_by
        :param unicode body: The body
        :param unicode media_sid: The media_sid

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From': from_,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy': last_updated_by,
            'Body': body,
            'MediaSid': media_sid,
        })

        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'],
        )
Пример #52
0
    def create(self, from_=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               last_updated_by=values.unset, body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The identity of the new message's author
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode last_updated_by: The Identity of the User who last updated the Message
        :param unicode body: The message to send to the channel
        :param unicode media_sid:  The Media Sid to be attached to the new Message

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From': from_,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy': last_updated_by,
            'Body': body,
            'MediaSid': media_sid,
        })

        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'],
        )
Пример #53
0
    def fetch(self, minutes=values.unset, start_date=values.unset,
              end_date=values.unset, task_queue_sid=values.unset,
              task_queue_name=values.unset, friendly_name=values.unset,
              task_channel=values.unset):
        """
        Fetch a WorkersStatisticsInstance

        :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 a end date.
        :param unicode task_queue_sid: Filter the real-time and cumulative statistics based on Workers tied to a particular queue
        :param unicode task_queue_name: Filter the real-time and cumulative statistics based on Workers tied to a particular queue
        :param unicode friendly_name: The friendly_name
        :param unicode task_channel: Filter cumulative statistics by TaskChannel.

        :returns: Fetched WorkersStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_statistics.WorkersStatisticsInstance
        """
        params = values.of({
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'EndDate': serialize.iso8601_datetime(end_date),
            'TaskQueueSid': task_queue_sid,
            'TaskQueueName': task_queue_name,
            'FriendlyName': friendly_name,
            'TaskChannel': task_channel,
        })

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

        return WorkersStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )
Пример #54
0
    def create(self, identity, role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset, date_created=values.unset,
               date_updated=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: The identity
        :param unicode role_sid: The role_sid
        :param unicode last_consumed_message_index: The last_consumed_message_index
        :param datetime last_consumption_timestamp: The last_consumption_timestamp
        :param datetime date_created: The date_created
        :param datetime date_updated: The date_updated

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity': identity,
            'RoleSid': role_sid,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

        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'],
        )
Пример #55
0
    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, call_sid=values.unset,
             conference_sid=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 datetime date_created_before: Filter by date created
        :param datetime date_created: Filter by date created
        :param datetime date_created_after: Filter by date created
        :param unicode call_sid: Filter by call_sid
        :param unicode conference_sid: The conference_sid
        :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: twilio.rest.api.v2010.account.recording.RecordingPage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_datetime(date_created_before),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateCreated>': serialize.iso8601_datetime(date_created_after),
            'CallSid': call_sid,
            'ConferenceSid': conference_sid,
            '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)
Пример #56
0
    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)
Пример #57
0
    def create(self, identity, role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset, date_created=values.unset,
               date_updated=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: A unique string identifier for this User in this Service. See the access tokens docs for more details.
        :param unicode role_sid: The role to be assigned to this member. Defaults to the roles specified on the Service.
        :param unicode last_consumed_message_index: Field used to specify the last consumed Message index for the Channel for this Member.  Should only be used when recreating a Member from a backup/separate source.
        :param datetime last_consumption_timestamp: ISO8601 time indicating the last datetime the Member consumed a Message in the Channel.  Should only be used when recreating a Member from a backup/separate source
        :param datetime date_created: The ISO8601 time specifying the datetime the Members should be set as being created.  Will be set to the current time by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source
        :param datetime date_updated: The ISO8601 time specifying the datetime the Member should be set as having been last updated.  Will be set to the null by the Chat service if not specified.  Note that this should only be used in cases where a Member is being recreated from a backup/separate source  and where a Member was previously updated.

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity': identity,
            'RoleSid': role_sid,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

        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'],
        )