本文整理汇总了Python中twilio.base.serialize.object函数的典型用法代码示例。如果您正苦于以下问题:Python object函数的具体用法?Python object怎么用?Python object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update
def update(self, friendly_name=values.unset, log_queries=values.unset,
unique_name=values.unset, callback_url=values.unset,
callback_events=values.unset, style_sheet=values.unset,
defaults=values.unset):
"""
Update the AssistantInstance
:param unicode friendly_name: A string to describe the resource
:param bool log_queries: Whether queries should be logged and kept after training
:param unicode unique_name: An application-defined string that uniquely identifies the resource
:param unicode callback_url: Reserved
:param unicode callback_events: Reserved
:param dict style_sheet: A JSON string that defines the Assistant's style sheet
:param dict defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios
:returns: Updated AssistantInstance
:rtype: twilio.rest.autopilot.v1.assistant.AssistantInstance
"""
data = values.of({
'FriendlyName': friendly_name,
'LogQueries': log_queries,
'UniqueName': unique_name,
'CallbackUrl': callback_url,
'CallbackEvents': callback_events,
'StyleSheet': serialize.object(style_sheet),
'Defaults': serialize.object(defaults),
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return AssistantInstance(self._version, payload, sid=self._solution['sid'], )
示例2: update
def update(self, friendly_name=values.unset, unique_name=values.unset,
actions=values.unset, actions_url=values.unset):
"""
Update the TaskInstance
:param unicode friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long.
:param unicode unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
:param dict actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique.
:param unicode actions_url: User-provided HTTP endpoint where from the assistant fetches actions
:returns: Updated TaskInstance
:rtype: twilio.rest.preview.understand.assistant.task.TaskInstance
"""
data = values.of({
'FriendlyName': friendly_name,
'UniqueName': unique_name,
'Actions': serialize.object(actions),
'ActionsUrl': actions_url,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return TaskInstance(
self._version,
payload,
assistant_sid=self._solution['assistant_sid'],
sid=self._solution['sid'],
)
示例3: update
def update(self, data=values.unset, ttl=values.unset):
"""
Update the SyncMapItemInstance
:param dict data: Contains an arbitrary JSON object to be stored in this Map Item.
:param unicode ttl: New time-to-live of this Map in seconds.
:returns: Updated SyncMapItemInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
"""
data = values.of({'Data': serialize.object(data), 'Ttl': ttl, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=self._solution['key'],
)
示例4: 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'],
)
示例5: create
def create(self, data):
"""
Create a new SyncListItemInstance
:param dict data: The data
:returns: Newly created SyncListItemInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance
"""
data = values.of({
'Data': serialize.object(data),
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return SyncListItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
)
示例6: create
def create(self, key, data):
"""
Create a new SyncMapItemInstance
:param unicode key: The key
:param dict data: The data
:returns: Newly created SyncMapItemInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
"""
data = values.of({
'Key': key,
'Data': serialize.object(data),
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
)
示例7: update
def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset,
collection_ttl=values.unset):
"""
Update the SyncMapItemInstance
:param dict data: Contains an arbitrary JSON object to be stored in this Map Item.
:param unicode ttl: Alias for item_ttl
:param unicode item_ttl: Time-to-live of this item in seconds, defaults to no expiration.
:param unicode collection_ttl: Time-to-live of this item's parent Map in seconds, defaults to no expiration.
:returns: Updated SyncMapItemInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
"""
data = values.of({
'Data': serialize.object(data),
'Ttl': ttl,
'ItemTtl': item_ttl,
'CollectionTtl': collection_ttl,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=self._solution['key'],
)
示例8: update
def update(self, configuration=values.unset, unique_name=values.unset):
"""
Update the InstalledAddOnInstance
:param dict configuration: The JSON object representing the configuration
:param unicode unique_name: The string that uniquely identifies this Add-on installation
:returns: Updated InstalledAddOnInstance
:rtype: twilio.rest.preview.marketplace.installed_add_on.InstalledAddOnInstance
"""
data = values.of({
'Configuration': serialize.object(configuration),
'UniqueName': unique_name,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return InstalledAddOnInstance(
self._version,
payload,
sid=self._solution['sid'],
)
示例9: update
def update(self, data=values.unset, ttl=values.unset, item_ttl=values.unset,
collection_ttl=values.unset):
"""
Update the SyncListItemInstance
:param dict data: Contains arbitrary user-defined, schema-less data that this List Item stores, represented by a JSON object, up to 16KB.
:param unicode ttl: Alias for item_ttl
:param unicode item_ttl: Time-to-live of this item in seconds, defaults to no expiration.
:param unicode collection_ttl: Time-to-live of this item's parent List in seconds, defaults to no expiration.
:returns: Updated SyncListItemInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance
"""
data = values.of({
'Data': serialize.object(data),
'Ttl': ttl,
'ItemTtl': item_ttl,
'CollectionTtl': collection_ttl,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncListItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
index=self._solution['index'],
)
示例10: create
def create(self, available_add_on_sid, accept_terms_of_service,
configuration=values.unset, unique_name=values.unset):
"""
Create a new InstalledAddOnInstance
:param unicode available_add_on_sid: A string that uniquely identifies the Add-on to install
:param bool accept_terms_of_service: A boolean reflecting your acceptance of the Terms of Service
:param dict configuration: The JSON object representing the configuration
:param unicode unique_name: The string that uniquely identifies this Add-on installation
:returns: Newly created InstalledAddOnInstance
:rtype: twilio.rest.preview.marketplace.installed_add_on.InstalledAddOnInstance
"""
data = values.of({
'AvailableAddOnSid': available_add_on_sid,
'AcceptTermsOfService': accept_terms_of_service,
'Configuration': serialize.object(configuration),
'UniqueName': unique_name,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return InstalledAddOnInstance(self._version, payload, )
示例11: create
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'], )
示例12: update
def update(self, data):
"""
Update the DocumentInstance
:param dict data: The data
:returns: Updated DocumentInstance
:rtype: twilio.rest.preview.sync.service.document.DocumentInstance
"""
data = values.of({
'Data': serialize.object(data),
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return DocumentInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
sid=self._solution['sid'],
)
示例13: create
def create(self, unique_name=values.unset, data=values.unset):
"""
Create a new DocumentInstance
:param unicode unique_name: The unique_name
:param dict data: The data
:returns: Newly created DocumentInstance
:rtype: twilio.rest.preview.sync.service.document.DocumentInstance
"""
data = values.of({
'UniqueName': unique_name,
'Data': serialize.object(data),
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return DocumentInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
)
示例14: update
def update(self, data):
"""
Update the SyncMapItemInstance
:param dict data: The data
:returns: Updated SyncMapItemInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
"""
data = values.of({
'Data': serialize.object(data),
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=self._solution['key'],
)
示例15: update
def update(self, data):
"""
Update the SyncListItemInstance
:param dict data: The data
:returns: Updated SyncListItemInstance
:rtype: twilio.rest.preview.sync.service.sync_list.sync_list_item.SyncListItemInstance
"""
data = values.of({
'Data': serialize.object(data),
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncListItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
index=self._solution['index'],
)