From d97b0984cb10107de9f74db4ff0c90927dcc8859 Mon Sep 17 00:00:00 2001 From: geekerzp Date: Thu, 2 Jul 2015 15:43:05 +0800 Subject: [PATCH] Update ApiClient of python client. Add docstring for method call_api. --- .../main/resources/python/api_client.mustache | 21 +++++++++++++++++++ .../python/swagger_client/api_client.py | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 95f727ff374f..4ed65ede6972 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -222,6 +222,27 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response=None, auth_settings=None, callback=None): + """ + Perform http request and return deserialized data + + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. + :param callback function: Callback function for asynchronous request. + If provide this parameter, the request will be called asynchronously. + :return: + If provide parameter callback, the request will be called asynchronously. + The method will return the request thread. + If parameter callback is None, then the method will return the response directly. + """ if callback is None: return self.__call_api(resource_path, method, path_params, query_params, header_params, diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py index 57abdb847e28..7afe93f01d40 100644 --- a/samples/client/petstore/python/swagger_client/api_client.py +++ b/samples/client/petstore/python/swagger_client/api_client.py @@ -222,6 +222,27 @@ class ApiClient(object): path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response=None, auth_settings=None, callback=None): + """ + Perform http request and return deserialized data + + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, for `multipart/form-data`. + :param callback function: Callback function for asynchronous request. + If provide this parameter, the request will be called asynchronously. + :return: + If provide parameter callback, the request will be called asynchronously. + The method will return the request thread. + If parameter callback is None, then the method will return the response directly. + """ if callback is None: return self.__call_api(resource_path, method, path_params, query_params, header_params,