本文整理汇总了Python中twilio.base.serialize.iso8601_datetime函数的典型用法代码示例。如果您正苦于以下问题:Python iso8601_datetime函数的具体用法?Python iso8601_datetime怎么用?Python iso8601_datetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iso8601_datetime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
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'],
)
示例2: fetch
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'],
)
示例3: create
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'], )
示例4: create
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'], )
示例5: page
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)
示例6: page
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)
示例7: page
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)
示例8: create
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'], )
示例9: page
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)
示例10: page
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)
示例11: create
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'], )
示例12: fetch
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'],
)
示例13: create
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, )
示例14: page
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)
示例15: update
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'],
)