mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 06:02:44 +00:00
[Python][Client] pure library client package (#470)
* Python client pure library package * check onlyPackage CLI option * run /bin/python-petstore.sh, update the python samples for CI * onlyPackage local variable instead of classp property * fix CI: __future__ absolute_import must be first in file * update samples * generateSourceCodeOnly * updated samples
This commit is contained in:
committed by
William Cheng
parent
925ae68167
commit
84ef98f067
@@ -179,3 +179,4 @@ Class | Method | HTTP request | Description
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ Name | Type | Description | Notes
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **upload_file_with_required_file**
|
||||
> ApiResponse upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
|
||||
> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
@@ -449,12 +449,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||
pet_id = 56 # int | ID of pet to update
|
||||
file = '/path/to/file' # file | file to upload
|
||||
required_file = '/path/to/file' # file | file to upload
|
||||
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
|
||||
|
||||
try:
|
||||
# uploads an image (required)
|
||||
api_response = api_instance.upload_file_with_required_file(pet_id, file, additional_metadata=additional_metadata)
|
||||
api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
|
||||
@@ -465,7 +465,7 @@ except ApiException as e:
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet_id** | **int**| ID of pet to update |
|
||||
**file** | **file**| file to upload |
|
||||
**required_file** | **file**| file to upload |
|
||||
**additional_metadata** | **str**| Additional data to pass to server | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from petstore_api.api.another_fake_api import AnotherFakeApi
|
||||
from petstore_api.api.fake_api import FakeApi
|
||||
|
||||
@@ -812,17 +812,17 @@ class PetApi(object):
|
||||
_request_timeout=local_var_params.get('_request_timeout'),
|
||||
collection_formats=collection_formats)
|
||||
|
||||
def upload_file_with_required_file(self, pet_id, file, **kwargs): # noqa: E501
|
||||
def upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
|
||||
"""uploads an image (required) # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async=True
|
||||
>>> thread = api.upload_file_with_required_file(pet_id, file, async=True)
|
||||
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async bool
|
||||
:param int pet_id: ID of pet to update (required)
|
||||
:param file file: file to upload (required)
|
||||
:param file required_file: file to upload (required)
|
||||
:param str additional_metadata: Additional data to pass to server
|
||||
:return: ApiResponse
|
||||
If the method is called asynchronously,
|
||||
@@ -830,22 +830,22 @@ class PetApi(object):
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async'):
|
||||
return self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
|
||||
return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.upload_file_with_required_file_with_http_info(pet_id, file, **kwargs) # noqa: E501
|
||||
(data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def upload_file_with_required_file_with_http_info(self, pet_id, file, **kwargs): # noqa: E501
|
||||
def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501
|
||||
"""uploads an image (required) # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async=True
|
||||
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, file, async=True)
|
||||
>>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async bool
|
||||
:param int pet_id: ID of pet to update (required)
|
||||
:param file file: file to upload (required)
|
||||
:param file required_file: file to upload (required)
|
||||
:param str additional_metadata: Additional data to pass to server
|
||||
:return: ApiResponse
|
||||
If the method is called asynchronously,
|
||||
@@ -854,7 +854,7 @@ class PetApi(object):
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ['pet_id', 'file', 'additional_metadata'] # noqa: E501
|
||||
all_params = ['pet_id', 'required_file', 'additional_metadata'] # noqa: E501
|
||||
all_params.append('async')
|
||||
all_params.append('_return_http_data_only')
|
||||
all_params.append('_preload_content')
|
||||
@@ -872,10 +872,10 @@ class PetApi(object):
|
||||
if ('pet_id' not in local_var_params or
|
||||
local_var_params['pet_id'] is None):
|
||||
raise ValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501
|
||||
# verify the required parameter 'file' is set
|
||||
if ('file' not in local_var_params or
|
||||
local_var_params['file'] is None):
|
||||
raise ValueError("Missing the required parameter `file` when calling `upload_file_with_required_file`") # noqa: E501
|
||||
# verify the required parameter 'required_file' is set
|
||||
if ('required_file' not in local_var_params or
|
||||
local_var_params['required_file'] is None):
|
||||
raise ValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
@@ -891,8 +891,8 @@ class PetApi(object):
|
||||
local_var_files = {}
|
||||
if 'additional_metadata' in local_var_params:
|
||||
form_params.append(('additionalMetadata', local_var_params['additional_metadata'])) # noqa: E501
|
||||
if 'file' in local_var_params:
|
||||
local_var_files['file'] = local_var_params['file'] # noqa: E501
|
||||
if 'required_file' in local_var_params:
|
||||
local_var_files['requiredFile'] = local_var_params['required_file'] # noqa: E501
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
|
||||
Reference in New Issue
Block a user