本文整理汇总了Python中intercom.Intercom.post方法的典型用法代码示例。如果您正苦于以下问题:Python Intercom.post方法的具体用法?Python Intercom.post怎么用?Python Intercom.post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类intercom.Intercom
的用法示例。
在下文中一共展示了Intercom.post方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reply
# 需要导入模块: from intercom import Intercom [as 别名]
# 或者: from intercom.Intercom import post [as 别名]
def reply(self, **reply_data):
from intercom import Intercom
collection = utils.resource_class_to_collection_name(self.__class__)
url = "/%s/%s/reply" % (collection, self.id)
reply_data['conversation_id'] = self.id
response = Intercom.post(url, **reply_data)
return self.from_response(response)
示例2: create
# 需要导入模块: from intercom import Intercom [as 别名]
# 或者: from intercom.Intercom import post [as 别名]
def create(cls, **params):
from intercom import Intercom
collection = utils.resource_class_to_collection_name(cls)
response = Intercom.post("/%s/" % (collection), **params)
if response: # may be empty if we received a 202
return cls(**response)
示例3: save
# 需要导入模块: from intercom import Intercom [as 别名]
# 或者: from intercom.Intercom import post [as 别名]
def save(self):
from intercom import Intercom
collection = utils.resource_class_to_collection_name(self.__class__)
params = self.attributes
if self.id_present and not self.posted_updates:
# update
response = Intercom.put('/%s/%s' % (collection, self.id), **params)
else:
# create
params.update(self.identity_hash)
response = Intercom.post('/%s' % (collection), **params)
if response:
return self.from_response(response)
示例4: _tag_collection
# 需要导入模块: from intercom import Intercom [as 别名]
# 或者: from intercom.Intercom import post [as 别名]
def _tag_collection(
cls, collection_name, name, objects, untag=False):
from intercom import Intercom
collection = utils.resource_class_to_collection_name(cls)
object_ids = []
for obj in objects:
if not hasattr(obj, 'keys'):
obj = {'id': obj}
if untag:
obj['untag'] = True
object_ids.append(obj)
params = {
'name': name,
collection_name: object_ids,
}
response = Intercom.post("/%s" % (collection), **params)
return cls(**response)