本文整理汇总了Python中twilio.base.serialize.object函数的典型用法代码示例。如果您正苦于以下问题:Python object函数的具体用法?Python object怎么用?Python object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:35,代码来源:__init__.py
示例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'],
)
开发者ID:twilio,项目名称:twilio-python,代码行数:32,代码来源:__init__.py
示例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'],
)
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:25,代码来源:sync_map_item.py
示例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'],
)
开发者ID:twilio,项目名称:twilio-python,代码行数:34,代码来源:__init__.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:25,代码来源:sync_list_item.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:27,代码来源:sync_map_item.py
示例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'],
)
开发者ID:twilio,项目名称:twilio-python,代码行数:33,代码来源:sync_map_item.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:26,代码来源:__init__.py
示例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'],
)
开发者ID:twilio,项目名称:twilio-python,代码行数:33,代码来源:sync_list_item.py
示例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, )
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:27,代码来源:__init__.py
示例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'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:32,代码来源:__init__.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:25,代码来源:__init__.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:26,代码来源:__init__.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:26,代码来源:sync_map_item.py
示例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'],
)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:26,代码来源:sync_list_item.py
示例16: create
def create(self, key, data, ttl=values.unset, item_ttl=values.unset,
collection_ttl=values.unset):
"""
Create a new SyncMapItemInstance
:param unicode key: The unique user-defined key of this Map Item.
:param dict data: Contains arbitrary user-defined, schema-less data that this Map 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 Map in seconds, defaults to no expiration.
: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),
'Ttl': ttl,
'ItemTtl': item_ttl,
'CollectionTtl': collection_ttl,
})
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'],
)
开发者ID:twilio,项目名称:twilio-python,代码行数:34,代码来源:sync_map_item.py
示例17: create
def create(self, body=values.unset, priority=values.unset, ttl=values.unset,
title=values.unset, sound=values.unset, action=values.unset,
data=values.unset, apn=values.unset, gcm=values.unset,
sms=values.unset, facebook_messenger=values.unset, fcm=values.unset,
segment=values.unset, alexa=values.unset, to_binding=values.unset,
identity=values.unset, tag=values.unset):
"""
Create a new NotificationInstance
:param unicode body: Indicates the notification body text.
:param NotificationInstance.Priority priority: Two priorities defined: low and high.
:param unicode ttl: This parameter specifies how long the notification is valid.
:param unicode title: Indicates the notification title.
:param unicode sound: Indicates a sound to be played.
:param unicode action: Specifies the actions to be displayed for the notification.
:param dict data: This parameter specifies the custom key-value pairs of the notification's payload.
:param dict apn: APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.
:param dict gcm: GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.
:param dict sms: SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.
:param dict facebook_messenger: Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.
:param dict fcm: FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.
:param unicode segment: The segment
:param dict alexa: The alexa
:param unicode to_binding: The destination address in a JSON object.
:param unicode identity: Delivery will be attempted only to Bindings with an Identity in this list.
:param unicode tag: Delivery will be attempted only to Bindings that have all of the Tags in this list.
:returns: Newly created NotificationInstance
:rtype: twilio.rest.notify.v1.service.notification.NotificationInstance
"""
data = values.of({
'Identity': serialize.map(identity, lambda e: e),
'Tag': serialize.map(tag, lambda e: e),
'Body': body,
'Priority': priority,
'Ttl': ttl,
'Title': title,
'Sound': sound,
'Action': action,
'Data': serialize.object(data),
'Apn': serialize.object(apn),
'Gcm': serialize.object(gcm),
'Sms': serialize.object(sms),
'FacebookMessenger': serialize.object(facebook_messenger),
'Fcm': serialize.object(fcm),
'Segment': serialize.map(segment, lambda e: e),
'Alexa': serialize.object(alexa),
'ToBinding': serialize.map(to_binding, lambda e: e),
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return NotificationInstance(self._version, payload, service_sid=self._solution['service_sid'], )
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:57,代码来源:notification.py
示例18: create
def create(self, body=values.unset, priority=values.unset, ttl=values.unset,
title=values.unset, sound=values.unset, action=values.unset,
data=values.unset, apn=values.unset, gcm=values.unset,
sms=values.unset, facebook_messenger=values.unset, fcm=values.unset,
segment=values.unset, alexa=values.unset, to_binding=values.unset,
identity=values.unset, tag=values.unset):
"""
Create a new NotificationInstance
:param unicode body: The notification body text
:param NotificationInstance.Priority priority: The priority of the notification
:param unicode ttl: How long, in seconds, the notification is valid
:param unicode title: The notification title
:param unicode sound: The name of the sound to be played for the notification
:param unicode action: The actions to display for the notification
:param dict data: The custom key-value pairs of the notification's payload
:param dict apn: The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings
:param dict gcm: The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings
:param dict sms: The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings
:param dict facebook_messenger: Deprecated
:param dict fcm: The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings
:param unicode segment: A Segment to notify
:param dict alexa: Deprecated
:param unicode to_binding: The destination address specified as a JSON string
:param unicode identity: The `identity` value that identifies the new resource's User
:param unicode tag: A tag that selects the Bindings to notify
:returns: Newly created NotificationInstance
:rtype: twilio.rest.notify.v1.service.notification.NotificationInstance
"""
data = values.of({
'Identity': serialize.map(identity, lambda e: e),
'Tag': serialize.map(tag, lambda e: e),
'Body': body,
'Priority': priority,
'Ttl': ttl,
'Title': title,
'Sound': sound,
'Action': action,
'Data': serialize.object(data),
'Apn': serialize.object(apn),
'Gcm': serialize.object(gcm),
'Sms': serialize.object(sms),
'FacebookMessenger': serialize.object(facebook_messenger),
'Fcm': serialize.object(fcm),
'Segment': serialize.map(segment, lambda e: e),
'Alexa': serialize.object(alexa),
'ToBinding': serialize.map(to_binding, lambda e: e),
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return NotificationInstance(self._version, payload, service_sid=self._solution['service_sid'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:57,代码来源:notification.py
示例19: test_update_request
def test_update_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.sync.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.documents(sid="ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update(data={})
values = {'Data': serialize.object({}), }
self.holodeck.assert_has_request(Request(
'post',
'https://preview.twilio.com/Sync/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
data=values,
))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:14,代码来源:test_document.py
示例20: test_create_request
def test_create_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.sync.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.sync_maps(sid="MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.sync_map_items.create(key="key", data={})
values = {'Key': "key", 'Data': serialize.object({}), }
self.holodeck.assert_has_request(Request(
'post',
'https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Maps/MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items',
data=values,
))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:15,代码来源:test_sync_map_item.py
注:本文中的twilio.base.serialize.object函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论