本文整理汇总了Python中botocore.docs.docstring.ClientMethodDocstring方法的典型用法代码示例。如果您正苦于以下问题:Python docstring.ClientMethodDocstring方法的具体用法?Python docstring.ClientMethodDocstring怎么用?Python docstring.ClientMethodDocstring使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botocore.docs.docstring
的用法示例。
在下文中一共展示了docstring.ClientMethodDocstring方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_api_method
# 需要导入模块: from botocore.docs import docstring [as 别名]
# 或者: from botocore.docs.docstring import ClientMethodDocstring [as 别名]
def _create_api_method(self, py_operation_name, operation_name,
service_model):
def _api_call(self, *args, **kwargs):
# We're accepting *args so that we can give a more helpful
# error message than TypeError: _api_call takes exactly
# 1 argument.
if args:
raise TypeError(
"%s() only accepts keyword arguments." % py_operation_name)
# The "self" in this scope is referring to the BaseClient.
return self._make_api_call(operation_name, kwargs)
_api_call.__name__ = str(py_operation_name)
# Add the docstring to the client method
operation_model = service_model.operation_model(operation_name)
docstring = ClientMethodDocstring(
operation_model=operation_model,
method_name=operation_name,
event_emitter=self._event_emitter,
method_description=operation_model.documentation,
example_prefix='response = client.%s' % py_operation_name,
include_signature=False
)
_api_call.__doc__ = docstring
return _api_call