Exemple #1
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)
Exemple #2
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 TaskQueueCumulativeStatisticsInstance

        :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 TaskQueueCumulativeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_cumulative_statistics.TaskQueueCumulativeStatisticsInstance
        """
        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 TaskQueueCumulativeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            task_queue_sid=self._solution['task_queue_sid'],
        )
    def fetch(self,
              minutes=values.unset,
              start_date=values.unset,
              end_date=values.unset,
              task_channel=values.unset):
        """
        Fetch a WorkerStatisticsInstance

        :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_channel: Filter cumulative statistics by TaskChannel.

        :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),
            'TaskChannel': task_channel,
        })

        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'],
        )
Exemple #4
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)
    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)
Exemple #6
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.
        :param datetime date_created_before: Only show Recordings 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 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)
    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'],
        )
    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'],
        )
Exemple #9
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)
Exemple #10
0
    def page(self,
             status=values.unset,
             date_created_after=values.unset,
             date_created_before=values.unset,
             room_sid=values.unset,
             page_token=values.unset,
             page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of CompositionInstance records from the API.
        Request is executed immediately

        :param CompositionInstance.Status status: Only show Compositions with the given status.
        :param datetime date_created_after: Only show Compositions that started on or after this ISO8601 date-time.
        :param datetime date_created_before: Only show Compositions that started before this this ISO8601 date-time.
        :param unicode room_sid: Only show Compositions with the given Room 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 CompositionInstance
        :rtype: twilio.rest.video.v1.composition.CompositionPage
        """
        params = values.of({
            'Status':
            status,
            'DateCreatedAfter':
            serialize.iso8601_datetime(date_created_after),
            'DateCreatedBefore':
            serialize.iso8601_datetime(date_created_before),
            'RoomSid':
            room_sid,
            'PageToken':
            page_token,
            'Page':
            page_number,
            'PageSize':
            page_size,
        })

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

        return CompositionPage(self._version, response, self._solution)
Exemple #11
0
    def page(self,
             status=values.unset,
             identity=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 ParticipantInstance records from the API.
        Request is executed immediately

        :param ParticipantInstance.Status status: Only show Participants with the given Status.
        :param unicode identity: Only show Participants that connected to the Room using the provided Identity.
        :param datetime date_created_after: Only show Participants that started after this date, given as an UTC ISO 8601 Timestamp.
        :param datetime date_created_before: Only show Participants that started before this date, given as an UTC ISO 8601 Timestamp.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ParticipantInstance
        :rtype: twilio.rest.video.v1.room.room_participant.ParticipantPage
        """
        params = values.of({
            'Status':
            status,
            'Identity':
            identity,
            '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 ParticipantPage(self._version, response, self._solution)
    def page(self,
             status=values.unset,
             source_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 RoomRecordingInstance records from the API.
        Request is executed immediately

        :param RoomRecordingInstance.Status status: The status
        :param unicode source_sid: The source_sid
        :param datetime date_created_after: The date_created_after
        :param datetime date_created_before: The date_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 RoomRecordingInstance
        :rtype: twilio.rest.video.v1.room.recording.RoomRecordingPage
        """
        params = values.of({
            'Status':
            status,
            'SourceSid':
            source_sid,
            '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 RoomRecordingPage(self._version, response, self._solution)
    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: Only show Rooms with the given status.
        :param unicode unique_name: Only show Rooms with the provided Name.
        :param datetime date_created_after: Only show Rooms that started on or after this date, given as YYYY-MM-DD.
        :param datetime date_created_before: Only show 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
        """
        params = 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(
            'GET',
            self._uri,
            params=params,
        )

        return RoomPage(self._version, response, self._solution)
Exemple #14
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'],
        )
Exemple #15
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)
Exemple #16
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)
Exemple #17
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):
        """
        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.

        :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),
        })

        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'],
        )
    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'],
        )
    def page(self, to=values.unset, from_=values.unset,
             date_sent_before=values.unset, date_sent=values.unset,
             date_sent_after=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of MessageInstance records from the API.
        Request is executed immediately

        :param unicode to: Filter by messages to this number
        :param unicode from_: Filter by from number
        :param datetime date_sent_before: Filter by date sent
        :param datetime date_sent: Filter by date sent
        :param datetime date_sent_after: Filter by date sent
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of MessageInstance
        :rtype: twilio.rest.api.v2010.account.message.MessagePage
        """
        params = values.of({
            'To': to,
            'From': from_,
            'DateSent<': serialize.iso8601_datetime(date_sent_before),
            'DateSent': serialize.iso8601_datetime(date_sent),
            'DateSent>': serialize.iso8601_datetime(date_sent_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return MessagePage(self._version, response, self._solution)
    def page(self,
             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 page(self, from_=values.unset, to=values.unset,
             date_created_on_or_before=values.unset,
             date_created_after=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of FaxInstance records from the API.
        Request is executed immediately

        :param unicode from_: Include only faxes sent from
        :param unicode to: Include only faxes sent to
        :param datetime date_created_on_or_before: Include only faxes created on or before
        :param datetime date_created_after: Include only faxes created after
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of FaxInstance
        :rtype: twilio.rest.fax.v1.fax.FaxPage
        """
        params = values.of({
            'From': from_,
            'To': to,
            'DateCreatedOnOrBefore': serialize.iso8601_datetime(date_created_on_or_before),
            'DateCreatedAfter': serialize.iso8601_datetime(date_created_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return FaxPage(self._version, response, self._solution)
    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'],
        )
    def page(self, to=values.unset, from_=values.unset,
             parent_call_sid=values.unset, status=values.unset,
             start_time_before=values.unset, start_time=values.unset,
             start_time_after=values.unset, end_time_before=values.unset,
             end_time=values.unset, end_time_after=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of CallInstance records from the API.
        Request is executed immediately

        :param unicode to: Phone number or Client identifier to filter `to` on
        :param unicode from_: Phone number or Client identifier to filter `from` on
        :param unicode parent_call_sid: Parent Call Sid to filter on
        :param CallInstance.Status status: Status to filter on
        :param datetime start_time_before: StartTime to filter on
        :param datetime start_time: StartTime to filter on
        :param datetime start_time_after: StartTime to filter on
        :param datetime end_time_before: EndTime to filter on
        :param datetime end_time: EndTime to filter on
        :param datetime end_time_after: EndTime to filter on
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of CallInstance
        :rtype: twilio.rest.api.v2010.account.call.CallPage
        """
        params = values.of({
            'To': to,
            'From': from_,
            'ParentCallSid': parent_call_sid,
            'Status': status,
            'StartTime<': serialize.iso8601_datetime(start_time_before),
            'StartTime': serialize.iso8601_datetime(start_time),
            'StartTime>': serialize.iso8601_datetime(start_time_after),
            'EndTime<': serialize.iso8601_datetime(end_time_before),
            'EndTime': serialize.iso8601_datetime(end_time),
            'EndTime>': serialize.iso8601_datetime(end_time_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

        return CallPage(self._version, response, self._solution)
    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 date this Session should expire
        :param unicode ttl: TTL for a Session, in seconds.
        :param SessionInstance.Mode mode: The mode
        :param SessionInstance.Status status: The Status of this Session
        :param dict participants: The participants

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