本文整理汇总了Python中connector.Connector.from_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Connector.from_dict方法的具体用法?Python Connector.from_dict怎么用?Python Connector.from_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connector.Connector
的用法示例。
在下文中一共展示了Connector.from_dict方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_connectors
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import from_dict [as 别名]
def get_connectors(self):
resp_dict = self._root.get('%s/connectors' % API_VERSION, headers=self.headers)
connectors = [ Connector.from_dict(connector_dict) for connector_dict in resp_dict['connectors'] ]
return connectors
示例2: get_connector
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import from_dict [as 别名]
def get_connector(self, connector_id):
resp_dict = self._root.get('%s/connector/%d/' % (API_VERSION, connector_id), headers=self.headers)
if resp_dict['connector']:
return Connector.from_dict(resp_dict['connector'])
return None
示例3: get_connectors
# 需要导入模块: from connector import Connector [as 别名]
# 或者: from connector.Connector import from_dict [as 别名]
def get_connectors(self):
resp_dict = self._root.get('%s/connector/all' % API_VERSION, headers=self.headers)
connectors = [ Connector.from_dict(connector_dict, resp_dict['resources-connector']) for connector_dict in resp_dict['all'] ]
return connectors