def fetch(self, end_date=values.unset, friendly_name=values.unset, minutes=values.unset, start_date=values.unset): """ Fetch a TaskQueueStatisticsInstance :param datetime end_date: The end_date :param unicode friendly_name: The friendly_name :param unicode minutes: The minutes :param datetime start_date: The start_date :returns: Fetched TaskQueueStatisticsInstance :rtype: TaskQueueStatisticsInstance """ params = values.of({ 'EndDate': serialize.iso8601_datetime(end_date), 'FriendlyName': friendly_name, 'Minutes': minutes, 'StartDate': serialize.iso8601_datetime(start_date), }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return TaskQueueStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], task_queue_sid=self._solution['task_queue_sid'], )
def fetch(self, minutes=values.unset, start_date=values.unset, end_date=values.unset): """ Fetch a WorkflowStatisticsInstance :param unicode minutes: The minutes :param datetime start_date: The start_date :param datetime end_date: The end_date :returns: Fetched WorkflowStatisticsInstance :rtype: WorkflowStatisticsInstance """ params = values.of({ 'Minutes': minutes, 'StartDate': serialize.iso8601_datetime(start_date), 'EndDate': serialize.iso8601_datetime(end_date), }) payload = self._version.fetch( 'GET', self._uri, params=params, ) return WorkflowStatisticsInstance( self._version, payload, workspace_sid=self._solution['workspace_sid'], workflow_sid=self._solution['workflow_sid'], )
def 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: The end_date :param unicode event_type: The event_type :param unicode minutes: The minutes :param unicode reservation_sid: The reservation_sid :param datetime start_date: The start_date :param unicode task_queue_sid: The task_queue_sid :param unicode task_sid: The task_sid :param unicode worker_sid: The worker_sid :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: Page """ 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)
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: Page """ 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)
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: Page """ 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, workspace_sid=self._solution['workspace_sid'], )
def test_str(self): actual = serialize.iso8601_datetime('2015-01-02T03:04:05Z') self.assertEqual('2015-01-02T03:04:05Z', actual)
def test_date(self): value = datetime.date(2015, 1, 2) actual = serialize.iso8601_datetime(value) self.assertEqual('2015-01-02T00:00:00Z', actual)
def test_datetime(self): value = datetime.datetime(2015, 1, 2, 3, 4, 5, 6) actual = serialize.iso8601_datetime(value) self.assertEqual('2015-01-02T03:04:05Z', actual)
def test_unset(self): value = values.unset actual = serialize.iso8601_datetime(value) self.assertEqual(values.unset, actual)