diff --git a/bin/python-petstore.sh b/bin/python-petstore.sh index e93ca9847d5..433af183b50 100755 --- a/bin/python-petstore.sh +++ b/bin/python-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=bin/logback.xml" -ags="generate -t modules/swagger-codegen/src/main/resources/python -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python -DpackageName=petstore_api $@" +ags="generate -i modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml -l python -o samples/client/petstore/python $@" -# java $JAVA_OPTS -jar $executable $ags +java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore/python/.gitignore b/samples/client/petstore/python/.gitignore new file mode 100644 index 00000000000..a655050c263 --- /dev/null +++ b/samples/client/petstore/python/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/client/petstore/python/.swagger-codegen-ignore b/samples/client/petstore/python/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/python/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/python/.swagger-codegen/VERSION b/samples/client/petstore/python/.swagger-codegen/VERSION new file mode 100644 index 00000000000..5728f6c1f85 --- /dev/null +++ b/samples/client/petstore/python/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.travis.yml b/samples/client/petstore/python/.travis.yml new file mode 100644 index 00000000000..86211e2d4a2 --- /dev/null +++ b/samples/client/petstore/python/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md new file mode 100644 index 00000000000..7f265e02216 --- /dev/null +++ b/samples/client/petstore/python/README.md @@ -0,0 +1,241 @@ +# swagger-client +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import swagger_client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import swagger_client +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Animal() # Animal | Animal object that needs to be added to the store + +try: + # Add a new animal to the store + api_instance.add_animal(body) +except ApiException as e: + print("Exception when calling AnimalApi->add_animal: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) +animal_id = 789 # int | Animal id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a animal + api_instance.delete_animal(animal_id, api_key=api_key) +except ApiException as e: + print("Exception when calling AnimalApi->delete_animal: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) +animal_id = 789 # int | ID of pet to return + +try: + # Find animal by ID + api_response = api_instance.get_animal_by_id(animal_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnimalApi->get_animal_by_id: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Animal() # Animal | Animal object that needs to be added. + +try: + # Update an existing animal + api_instance.update_animal(body) +except ApiException as e: + print("Exception when calling AnimalApi->update_animal: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.AnimalApi(swagger_client.ApiClient(configuration)) +animal_id = 789 # int | ID of animal that needs to be updated +name = 'name_example' # str | (optional) +status = 'status_example' # str | (optional) + +try: + # Updates a animal + api_instance.update_animal_with_form(animal_id, name=name, status=status) +except ApiException as e: + print("Exception when calling AnimalApi->update_animal_with_form: %s\n" % e) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnimalApi* | [**add_animal**](docs/AnimalApi.md#add_animal) | **POST** /animal | Add a new animal to the store +*AnimalApi* | [**delete_animal**](docs/AnimalApi.md#delete_animal) | **DELETE** /animal/{animalId} | Deletes a animal +*AnimalApi* | [**get_animal_by_id**](docs/AnimalApi.md#get_animal_by_id) | **GET** /animal/{animalId} | Find animal by ID +*AnimalApi* | [**update_animal**](docs/AnimalApi.md#update_animal) | **PUT** /animal | Update an existing animal +*AnimalApi* | [**update_animal_with_form**](docs/AnimalApi.md#update_animal_with_form) | **POST** /animal/{animalId} | Updates a animal +*AnotherFakeApi* | [**test_special_tags**](docs/AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DogApi* | [**add_dog**](docs/DogApi.md#add_dog) | **POST** /dog | Add a new dog to the store +*DogApi* | [**delete_dog**](docs/DogApi.md#delete_dog) | **DELETE** /dog/{dogId} | Deletes a dog +*DogApi* | [**get_dog_by_id**](docs/DogApi.md#get_dog_by_id) | **GET** /dog/{dogId} | Find dog by ID +*DogApi* | [**update_dog**](docs/DogApi.md#update_dog) | **PUT** /dog | Update an existing dog +*DogApi* | [**update_dog_with_form**](docs/DogApi.md#update_dog_with_form) | **POST** /dog/{dogId} | Updates a dog +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_enum_request_body**](docs/FakeApi.md#test_enum_request_body) | **POST** /fake/enum/form | To test enum parameters +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **POST** /fake/jsonFormData | test json serialization of form data +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_all_pets**](docs/PetApi.md#get_all_pets) | **GET** /allPets | +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**get_random_pet**](docs/PetApi.md#get_random_pet) | **GET** /randomPet | +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AllPetsResponse](docs/AllPetsResponse.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Body](docs/Body.md) + - [Body1](docs/Body1.md) + - [Body2](docs/Body2.md) + - [Body3](docs/Body3.md) + - [Body4](docs/Body4.md) + - [Body5](docs/Body5.md) + - [Body6](docs/Body6.md) + - [Body7](docs/Body7.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [OneOfAllPetsResponseItems](docs/OneOfAllPetsResponseItems.md) + - [OneOfSinglePetResponsePet](docs/OneOfSinglePetResponsePet.md) + - [Order](docs/Order.md) + - [OuterBoolean](docs/OuterBoolean.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterNumber](docs/OuterNumber.md) + - [OuterString](docs/OuterString.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SinglePetResponse](docs/SinglePetResponse.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +## http_basic_test + +- **Type**: HTTP basic authentication + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - ****: + + +## Author + +apiteam@swagger.io diff --git a/samples/client/petstore/python/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..263f6b10e4a --- /dev/null +++ b/samples/client/petstore/python/docs/AdditionalPropertiesClass.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **dict(str, str)** | | [optional] +**map_of_map_property** | **dict(str, dict(str, str))** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/AllPetsResponse.md b/samples/client/petstore/python/docs/AllPetsResponse.md new file mode 100644 index 00000000000..bd4ebb72b25 --- /dev/null +++ b/samples/client/petstore/python/docs/AllPetsResponse.md @@ -0,0 +1,8 @@ +# AllPetsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python/docs/Animal.md new file mode 100644 index 00000000000..dde186fbf57 --- /dev/null +++ b/samples/client/petstore/python/docs/Animal.md @@ -0,0 +1,10 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/AnimalApi.md b/samples/client/petstore/python/docs/AnimalApi.md new file mode 100644 index 00000000000..5725561068e --- /dev/null +++ b/samples/client/petstore/python/docs/AnimalApi.md @@ -0,0 +1,246 @@ +# swagger_client.AnimalApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_animal**](AnimalApi.md#add_animal) | **POST** /animal | Add a new animal to the store +[**delete_animal**](AnimalApi.md#delete_animal) | **DELETE** /animal/{animalId} | Deletes a animal +[**get_animal_by_id**](AnimalApi.md#get_animal_by_id) | **GET** /animal/{animalId} | Find animal by ID +[**update_animal**](AnimalApi.md#update_animal) | **PUT** /animal | Update an existing animal +[**update_animal_with_form**](AnimalApi.md#update_animal_with_form) | **POST** /animal/{animalId} | Updates a animal + +# **add_animal** +> add_animal(body) + +Add a new animal to the store + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi() +body = swagger_client.Animal() # Animal | Animal object that needs to be added to the store + +try: + # Add a new animal to the store + api_instance.add_animal(body) +except ApiException as e: + print("Exception when calling AnimalApi->add_animal: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Animal**](Animal.md)| Animal object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **delete_animal** +> delete_animal(animal_id, api_key=api_key) + +Deletes a animal + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi() +animal_id = 789 # int | Animal id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a animal + api_instance.delete_animal(animal_id, api_key=api_key) +except ApiException as e: + print("Exception when calling AnimalApi->delete_animal: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **animal_id** | **int**| Animal id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **get_animal_by_id** +> Animal get_animal_by_id(animal_id) + +Find animal by ID + +Returns a single animal + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi() +animal_id = 789 # int | ID of pet to return + +try: + # Find animal by ID + api_response = api_instance.get_animal_by_id(animal_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnimalApi->get_animal_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **animal_id** | **int**| ID of pet to return | + +### Return type + +[**Animal**](Animal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **update_animal** +> update_animal(body) + +Update an existing animal + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi() +body = swagger_client.Animal() # Animal | Animal object that needs to be added. + +try: + # Update an existing animal + api_instance.update_animal(body) +except ApiException as e: + print("Exception when calling AnimalApi->update_animal: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Animal**](Animal.md)| Animal object that needs to be added. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **update_animal_with_form** +> update_animal_with_form(animal_id, name=name, status=status) + +Updates a animal + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnimalApi() +animal_id = 789 # int | ID of animal that needs to be updated +name = 'name_example' # str | (optional) +status = 'status_example' # str | (optional) + +try: + # Updates a animal + api_instance.update_animal_with_form(animal_id, name=name, status=status) +except ApiException as e: + print("Exception when calling AnimalApi->update_animal_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **animal_id** | **int**| ID of animal that needs to be updated | + **name** | **str**| | [optional] + **status** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/python/docs/AnimalFarm.md b/samples/client/petstore/python/docs/AnimalFarm.md new file mode 100644 index 00000000000..6e2c9faa1ab --- /dev/null +++ b/samples/client/petstore/python/docs/AnimalFarm.md @@ -0,0 +1,8 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..98c6bc8a05e --- /dev/null +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# swagger_client.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_special_tags**](AnotherFakeApi.md#test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + +# **test_special_tags** +> Client test_special_tags(body) + +To test special tags + +To test special tags + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.AnotherFakeApi() +body = swagger_client.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.test_special_tags(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + diff --git a/samples/client/petstore/python/docs/ApiResponse.md b/samples/client/petstore/python/docs/ApiResponse.md new file mode 100644 index 00000000000..e1278d23b14 --- /dev/null +++ b/samples/client/petstore/python/docs/ApiResponse.md @@ -0,0 +1,11 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..dc78a49d8cc --- /dev/null +++ b/samples/client/petstore/python/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **list[list[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..88de4ca32ac --- /dev/null +++ b/samples/client/petstore/python/docs/ArrayOfNumberOnly.md @@ -0,0 +1,9 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **list[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/ArrayTest.md b/samples/client/petstore/python/docs/ArrayTest.md new file mode 100644 index 00000000000..7f9611a0c55 --- /dev/null +++ b/samples/client/petstore/python/docs/ArrayTest.md @@ -0,0 +1,11 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **list[str]** | | [optional] +**array_array_of_integer** | **list[list[int]]** | | [optional] +**array_array_of_model** | **list[list[ReadOnlyFirst]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body.md b/samples/client/petstore/python/docs/Body.md new file mode 100644 index 00000000000..79795941dc5 --- /dev/null +++ b/samples/client/petstore/python/docs/Body.md @@ -0,0 +1,10 @@ +# Body + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body1.md b/samples/client/petstore/python/docs/Body1.md new file mode 100644 index 00000000000..e6864ffbf7f --- /dev/null +++ b/samples/client/petstore/python/docs/Body1.md @@ -0,0 +1,10 @@ +# Body1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **str** | Additional data to pass to server | [optional] +**file** | **str** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body2.md b/samples/client/petstore/python/docs/Body2.md new file mode 100644 index 00000000000..41c63113835 --- /dev/null +++ b/samples/client/petstore/python/docs/Body2.md @@ -0,0 +1,22 @@ +# Body2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**number** | **float** | None | +**_float** | **float** | None | [optional] +**double** | **float** | None | +**string** | **str** | None | [optional] +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**binary** | **str** | None | [optional] +**_date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body3.md b/samples/client/petstore/python/docs/Body3.md new file mode 100644 index 00000000000..7266bbf8850 --- /dev/null +++ b/samples/client/petstore/python/docs/Body3.md @@ -0,0 +1,22 @@ +# Body3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**number** | **float** | None | +**_float** | **float** | None | [optional] +**double** | **float** | None | +**string** | **str** | None | [optional] +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**binary** | **str** | None | [optional] +**_date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body4.md b/samples/client/petstore/python/docs/Body4.md new file mode 100644 index 00000000000..348ded84608 --- /dev/null +++ b/samples/client/petstore/python/docs/Body4.md @@ -0,0 +1,11 @@ +# Body4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg'] +**enum_query_double** | **float** | Query parameter enum test (double) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body5.md b/samples/client/petstore/python/docs/Body5.md new file mode 100644 index 00000000000..b98992ce7cf --- /dev/null +++ b/samples/client/petstore/python/docs/Body5.md @@ -0,0 +1,10 @@ +# Body5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body6.md b/samples/client/petstore/python/docs/Body6.md new file mode 100644 index 00000000000..f88c9cd5a37 --- /dev/null +++ b/samples/client/petstore/python/docs/Body6.md @@ -0,0 +1,10 @@ +# Body6 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the animal | [optional] +**status** | **str** | Updated status of the animal | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Body7.md b/samples/client/petstore/python/docs/Body7.md new file mode 100644 index 00000000000..7fef7b2b6d2 --- /dev/null +++ b/samples/client/petstore/python/docs/Body7.md @@ -0,0 +1,10 @@ +# Body7 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the dog | [optional] +**status** | **str** | Updated status of the dog | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Capitalization.md b/samples/client/petstore/python/docs/Capitalization.md new file mode 100644 index 00000000000..43978f47adb --- /dev/null +++ b/samples/client/petstore/python/docs/Capitalization.md @@ -0,0 +1,14 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Cat.md b/samples/client/petstore/python/docs/Cat.md new file mode 100644 index 00000000000..833a182b40a --- /dev/null +++ b/samples/client/petstore/python/docs/Cat.md @@ -0,0 +1,11 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python/docs/Category.md new file mode 100644 index 00000000000..22b1fbfa45e --- /dev/null +++ b/samples/client/petstore/python/docs/Category.md @@ -0,0 +1,10 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/ClassModel.md b/samples/client/petstore/python/docs/ClassModel.md new file mode 100644 index 00000000000..1b32f68ed56 --- /dev/null +++ b/samples/client/petstore/python/docs/ClassModel.md @@ -0,0 +1,9 @@ +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Client.md b/samples/client/petstore/python/docs/Client.md new file mode 100644 index 00000000000..268ec0b9ee5 --- /dev/null +++ b/samples/client/petstore/python/docs/Client.md @@ -0,0 +1,9 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Dog.md b/samples/client/petstore/python/docs/Dog.md new file mode 100644 index 00000000000..1fce53f7cb6 --- /dev/null +++ b/samples/client/petstore/python/docs/Dog.md @@ -0,0 +1,11 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] [default to 'red'] +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/DogApi.md b/samples/client/petstore/python/docs/DogApi.md new file mode 100644 index 00000000000..3d619d4f34c --- /dev/null +++ b/samples/client/petstore/python/docs/DogApi.md @@ -0,0 +1,246 @@ +# swagger_client.DogApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_dog**](DogApi.md#add_dog) | **POST** /dog | Add a new dog to the store +[**delete_dog**](DogApi.md#delete_dog) | **DELETE** /dog/{dogId} | Deletes a dog +[**get_dog_by_id**](DogApi.md#get_dog_by_id) | **GET** /dog/{dogId} | Find dog by ID +[**update_dog**](DogApi.md#update_dog) | **PUT** /dog | Update an existing dog +[**update_dog_with_form**](DogApi.md#update_dog_with_form) | **POST** /dog/{dogId} | Updates a dog + +# **add_dog** +> add_dog(body) + +Add a new dog to the store + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DogApi() +body = swagger_client.Dog() # Dog | Dog object that needs to be added to the store + +try: + # Add a new dog to the store + api_instance.add_dog(body) +except ApiException as e: + print("Exception when calling DogApi->add_dog: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Dog**](Dog.md)| Dog object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **delete_dog** +> delete_dog(dog_id, api_key=api_key) + +Deletes a dog + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DogApi() +dog_id = 789 # int | Dog id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a dog + api_instance.delete_dog(dog_id, api_key=api_key) +except ApiException as e: + print("Exception when calling DogApi->delete_dog: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dog_id** | **int**| Dog id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **get_dog_by_id** +> Dog get_dog_by_id(dog_id) + +Find dog by ID + +Returns a single dog + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DogApi() +dog_id = 789 # int | ID of dog to return + +try: + # Find dog by ID + api_response = api_instance.get_dog_by_id(dog_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DogApi->get_dog_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dog_id** | **int**| ID of dog to return | + +### Return type + +[**Dog**](Dog.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **update_dog** +> update_dog(body) + +Update an existing dog + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DogApi() +body = swagger_client.Dog() # Dog | Dog object that needs to be added. + +try: + # Update an existing dog + api_instance.update_dog(body) +except ApiException as e: + print("Exception when calling DogApi->update_dog: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Dog**](Dog.md)| Dog object that needs to be added. | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **update_dog_with_form** +> update_dog_with_form(animal_id, name=name, status=status) + +Updates a dog + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DogApi() +animal_id = 789 # int | ID of dog that needs to be updated +name = 'name_example' # str | (optional) +status = 'status_example' # str | (optional) + +try: + # Updates a dog + api_instance.update_dog_with_form(animal_id, name=name, status=status) +except ApiException as e: + print("Exception when calling DogApi->update_dog_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **animal_id** | **int**| ID of dog that needs to be updated | + **name** | **str**| | [optional] + **status** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/python/docs/EnumArrays.md b/samples/client/petstore/python/docs/EnumArrays.md new file mode 100644 index 00000000000..459f95f6532 --- /dev/null +++ b/samples/client/petstore/python/docs/EnumArrays.md @@ -0,0 +1,10 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **list[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/EnumClass.md b/samples/client/petstore/python/docs/EnumClass.md new file mode 100644 index 00000000000..27c75536506 --- /dev/null +++ b/samples/client/petstore/python/docs/EnumClass.md @@ -0,0 +1,8 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/EnumTest.md b/samples/client/petstore/python/docs/EnumTest.md new file mode 100644 index 00000000000..c4528852599 --- /dev/null +++ b/samples/client/petstore/python/docs/EnumTest.md @@ -0,0 +1,12 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md new file mode 100644 index 00000000000..c209830a0c2 --- /dev/null +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -0,0 +1,496 @@ +# swagger_client.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_enum_request_body**](FakeApi.md#test_enum_request_body) | **POST** /fake/enum/form | To test enum parameters +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **POST** /fake/jsonFormData | test json serialization of form data + +# **fake_outer_boolean_serialize** +> OuterBoolean fake_outer_boolean_serialize(body=body) + + + +Test serialization of outer boolean types + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = True # bool | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**bool**](bool.md)| Input boolean as post body | [optional] + +### Return type + +[**OuterBoolean**](OuterBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[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) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(body=body) + + + +Test serialization of object with outer number type + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = swagger_client.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[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) + +# **fake_outer_number_serialize** +> OuterNumber fake_outer_number_serialize(body=body) + + + +Test serialization of outer number types + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = 3.4 # float | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**float**](float.md)| Input number as post body | [optional] + +### Return type + +[**OuterNumber**](OuterNumber.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[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) + +# **fake_outer_string_serialize** +> OuterString fake_outer_string_serialize(body=body) + + + +Test serialization of outer string types + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = 'body_example' # str | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**str**](str.md)| Input string as post body | [optional] + +### Return type + +[**OuterString**](OuterString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: */* + +[[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) + +# **test_client_model** +> Client test_client_model(body) + +To test \"client\" model + +To test \"client\" model + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = swagger_client.Client() # Client | client model + +try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + +# **test_endpoint_parameters** +> test_endpoint_parameters(body) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint +# Configure HTTP basic authorization: http_basic_test +configuration = swagger_client.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = swagger_client.FakeApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Body2() # Body2 | + +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(body) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Body2**](Body2.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 + - **Accept**: Not defined + +[[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) + +# **test_enum_parameters** +> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer) + +To test enum parameters + +To test enum parameters + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +enum_header_string = 'enum_header_string_example' # str | Header parameter enum test (string) (optional) +enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) +enum_query_string = 'enum_query_string_example' # str | Query parameter enum test (string) (optional) +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) + +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] + **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **test_enum_request_body** +> test_enum_request_body(body=body) + +To test enum parameters + +To test enum parameters + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = swagger_client.Body4() # Body4 | (optional) + +try: + # To test enum parameters + api_instance.test_enum_request_body(body=body) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_request_body: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Body4**](Body4.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: Not defined + +[[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) + +# **test_inline_additional_properties** +> test_inline_additional_properties(body) + +test inline additionalProperties + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = NULL # dict(str, str) | request body + +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(body) +except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**dict(str, str)**](dict.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + +# **test_json_form_data** +> test_json_form_data(body) + +test json serialization of form data + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.FakeApi() +body = swagger_client.Body5() # Body5 | + +try: + # test json serialization of form data + api_instance.test_json_form_data(body) +except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Body5**](Body5.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..2f1e5226970 --- /dev/null +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -0,0 +1,60 @@ +# swagger_client.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + +# **test_classname** +> Client test_classname(body) + +To test class name in snake case + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key_query +configuration = swagger_client.Configuration() +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# create an instance of the API class +api_instance = swagger_client.FakeClassnameTags123Api(swagger_client.ApiClient(configuration)) +body = swagger_client.Client() # Client | client model + +try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + diff --git a/samples/client/petstore/python/docs/FormatTest.md b/samples/client/petstore/python/docs/FormatTest.md new file mode 100644 index 00000000000..d35227f4958 --- /dev/null +++ b/samples/client/petstore/python/docs/FormatTest.md @@ -0,0 +1,21 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**number** | **float** | | +**_float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**byte** | **str** | | +**binary** | **str** | | [optional] +**_date** | **date** | | +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**password** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/HasOnlyReadOnly.md b/samples/client/petstore/python/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..6cd08f19168 --- /dev/null +++ b/samples/client/petstore/python/docs/HasOnlyReadOnly.md @@ -0,0 +1,10 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**foo** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/List.md b/samples/client/petstore/python/docs/List.md new file mode 100644 index 00000000000..5f21fea22ed --- /dev/null +++ b/samples/client/petstore/python/docs/List.md @@ -0,0 +1,9 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/MapTest.md b/samples/client/petstore/python/docs/MapTest.md new file mode 100644 index 00000000000..86d6204c710 --- /dev/null +++ b/samples/client/petstore/python/docs/MapTest.md @@ -0,0 +1,10 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **dict(str, dict(str, str))** | | [optional] +**map_of_enum_string** | **dict(str, str)** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..6cdc17a0d0a --- /dev/null +++ b/samples/client/petstore/python/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**dict(str, Animal)**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Model200Response.md b/samples/client/petstore/python/docs/Model200Response.md new file mode 100644 index 00000000000..6bd4c282497 --- /dev/null +++ b/samples/client/petstore/python/docs/Model200Response.md @@ -0,0 +1,10 @@ +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/ModelReturn.md b/samples/client/petstore/python/docs/ModelReturn.md new file mode 100644 index 00000000000..f70bd507b76 --- /dev/null +++ b/samples/client/petstore/python/docs/ModelReturn.md @@ -0,0 +1,9 @@ +# ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Name.md b/samples/client/petstore/python/docs/Name.md new file mode 100644 index 00000000000..0c22dd305d8 --- /dev/null +++ b/samples/client/petstore/python/docs/Name.md @@ -0,0 +1,12 @@ +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/NumberOnly.md b/samples/client/petstore/python/docs/NumberOnly.md new file mode 100644 index 00000000000..671403360be --- /dev/null +++ b/samples/client/petstore/python/docs/NumberOnly.md @@ -0,0 +1,9 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OneOfAllPetsResponseItems.md b/samples/client/petstore/python/docs/OneOfAllPetsResponseItems.md new file mode 100644 index 00000000000..b31ee1440fb --- /dev/null +++ b/samples/client/petstore/python/docs/OneOfAllPetsResponseItems.md @@ -0,0 +1,8 @@ +# OneOfAllPetsResponseItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OneOfSinglePetResponsePet.md b/samples/client/petstore/python/docs/OneOfSinglePetResponsePet.md new file mode 100644 index 00000000000..f37fa929943 --- /dev/null +++ b/samples/client/petstore/python/docs/OneOfSinglePetResponsePet.md @@ -0,0 +1,8 @@ +# OneOfSinglePetResponsePet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Order.md b/samples/client/petstore/python/docs/Order.md new file mode 100644 index 00000000000..e91732f6152 --- /dev/null +++ b/samples/client/petstore/python/docs/Order.md @@ -0,0 +1,14 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to False] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OuterBoolean.md b/samples/client/petstore/python/docs/OuterBoolean.md new file mode 100644 index 00000000000..d06c25bc59a --- /dev/null +++ b/samples/client/petstore/python/docs/OuterBoolean.md @@ -0,0 +1,8 @@ +# OuterBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OuterComposite.md b/samples/client/petstore/python/docs/OuterComposite.md new file mode 100644 index 00000000000..8497d6af4d1 --- /dev/null +++ b/samples/client/petstore/python/docs/OuterComposite.md @@ -0,0 +1,11 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional] +**my_string** | [**OuterString**](OuterString.md) | | [optional] +**my_boolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OuterEnum.md b/samples/client/petstore/python/docs/OuterEnum.md new file mode 100644 index 00000000000..f5ce677fffb --- /dev/null +++ b/samples/client/petstore/python/docs/OuterEnum.md @@ -0,0 +1,8 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OuterNumber.md b/samples/client/petstore/python/docs/OuterNumber.md new file mode 100644 index 00000000000..0132834867e --- /dev/null +++ b/samples/client/petstore/python/docs/OuterNumber.md @@ -0,0 +1,8 @@ +# OuterNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/OuterString.md b/samples/client/petstore/python/docs/OuterString.md new file mode 100644 index 00000000000..eaf8710e157 --- /dev/null +++ b/samples/client/petstore/python/docs/OuterString.md @@ -0,0 +1,8 @@ +# OuterString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/Pet.md b/samples/client/petstore/python/docs/Pet.md new file mode 100644 index 00000000000..8094cc06484 --- /dev/null +++ b/samples/client/petstore/python/docs/Pet.md @@ -0,0 +1,14 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **str** | | +**photo_urls** | **list[str]** | | +**tags** | [**list[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md new file mode 100644 index 00000000000..1119f0f4195 --- /dev/null +++ b/samples/client/petstore/python/docs/PetApi.md @@ -0,0 +1,513 @@ +# swagger_client.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_all_pets**](PetApi.md#get_all_pets) | **GET** /allPets | +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**get_random_pet**](PetApi.md#get_random_pet) | **GET** /randomPet | +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image + +# **add_pet** +> add_pet(body) + +Add a new pet to the store + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Add a new pet to the store + api_instance.add_pet(body) +except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **delete_pet** +> delete_pet(pet_id, api_key=api_key) + +Deletes a pet + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +pet_id = 789 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **find_pets_by_status** +> list[Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +status = ['status_example'] # list[str] | Status values that need to be considered for filter + +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **find_pets_by_tags** +> list[Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +tags = ['tags_example'] # list[str] | Tags to filter by + +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**list[str]**](str.md)| Tags to filter by | + +### Return type + +[**list[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **get_all_pets** +> AllPetsResponse get_all_pets() + + + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.PetApi() + +try: + api_response = api_instance.get_all_pets() + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_all_pets: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AllPetsResponse**](AllPetsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = swagger_client.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to return + +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **get_random_pet** +> SinglePetResponse get_random_pet() + + + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.PetApi() + +try: + api_response = api_instance.get_random_pet() + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_random_pet: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**SinglePetResponse**](SinglePetResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **update_pet** +> update_pet(body) + +Update an existing pet + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Update an existing pet + api_instance.update_pet(body) +except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[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) + +# **update_pet_with_form** +> update_pet_with_form(pet_id, name=name, status=status) + +Updates a pet in the store with form data + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +pet_id = 789 # int | ID of pet that needs to be updated +name = 'name_example' # str | (optional) +status = 'status_example' # str | (optional) + +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| | [optional] + **status** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[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** +> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) + +uploads an image + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: petstore_auth +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.PetApi(swagger_client.ApiClient(configuration)) +pet_id = 789 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | (optional) +file = 'file_example' # str | (optional) + +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| | [optional] + **file** | **str**| | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[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) + diff --git a/samples/client/petstore/python/docs/ReadOnlyFirst.md b/samples/client/petstore/python/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..28e76259c15 --- /dev/null +++ b/samples/client/petstore/python/docs/ReadOnlyFirst.md @@ -0,0 +1,10 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/SinglePetResponse.md b/samples/client/petstore/python/docs/SinglePetResponse.md new file mode 100644 index 00000000000..d4a3def1ea6 --- /dev/null +++ b/samples/client/petstore/python/docs/SinglePetResponse.md @@ -0,0 +1,9 @@ +# SinglePetResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pet** | [**OneOfSinglePetResponsePet**](OneOfSinglePetResponsePet.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/SpecialModelName.md b/samples/client/petstore/python/docs/SpecialModelName.md new file mode 100644 index 00000000000..dd5c1f657bc --- /dev/null +++ b/samples/client/petstore/python/docs/SpecialModelName.md @@ -0,0 +1,9 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md new file mode 100644 index 00000000000..0bdb5c14177 --- /dev/null +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -0,0 +1,202 @@ +# swagger_client.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **get_inventory** +> dict(str, int) get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = swagger_client.Configuration() +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# create an instance of the API class +api_instance = swagger_client.StoreApi(swagger_client.ApiClient(configuration)) + +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**dict(str, int)** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.StoreApi() +order_id = 789 # int | ID of pet that needs to be fetched + +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **place_order** +> Order place_order(body) + +Place an order for a pet + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.StoreApi() +body = swagger_client.Order() # Order | order placed for purchasing the pet + +try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: application/xml, application/json + +[[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) + diff --git a/samples/client/petstore/python/docs/Tag.md b/samples/client/petstore/python/docs/Tag.md new file mode 100644 index 00000000000..f269d998aa8 --- /dev/null +++ b/samples/client/petstore/python/docs/Tag.md @@ -0,0 +1,10 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/User.md b/samples/client/petstore/python/docs/User.md new file mode 100644 index 00000000000..f4683b600b3 --- /dev/null +++ b/samples/client/petstore/python/docs/User.md @@ -0,0 +1,16 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md new file mode 100644 index 00000000000..676bd7672a8 --- /dev/null +++ b/samples/client/petstore/python/docs/UserApi.md @@ -0,0 +1,383 @@ +# swagger_client.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + +# **create_user** +> create_user(body) + +Create user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +body = swagger_client.User() # User | Created user object + +try: + # Create user + api_instance.create_user(body) +except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: Not defined + +[[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) + +# **create_users_with_array_input** +> create_users_with_array_input(body) + +Creates list of users with given input array + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +body = [swagger_client.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: Not defined + +[[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) + +# **create_users_with_list_input** +> create_users_with_list_input(body) + +Creates list of users with given input array + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +body = [swagger_client.User()] # list[User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**list[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: Not defined + +[[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) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +try: + # Delete user + api_instance.delete_user(username) +except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[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) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() + +try: + # Logs out current logged in user session + api_instance.logout_user() +except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **update_user** +> update_user(body, username) + +Updated user + +This can only be done by the logged in user. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.UserApi() +body = swagger_client.User() # User | Updated user object +username = 'username_example' # str | name that need to be deleted + +try: + # Updated user + api_instance.update_user(body, username) +except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Updated user object | + **username** | **str**| name that need to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: */* + - **Accept**: Not defined + +[[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) + diff --git a/samples/client/petstore/python/git_push.sh b/samples/client/petstore/python/git_push.sh new file mode 100644 index 00000000000..ae01b182ae9 --- /dev/null +++ b/samples/client/petstore/python/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/python/requirements.txt b/samples/client/petstore/python/requirements.txt new file mode 100644 index 00000000000..bafdc07532f --- /dev/null +++ b/samples/client/petstore/python/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/client/petstore/python/setup.py b/samples/client/petstore/python/setup.py new file mode 100644 index 00000000000..395bd0aa355 --- /dev/null +++ b/samples/client/petstore/python/setup.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "swagger-client" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] + +setup( + name=NAME, + version=VERSION, + description="Swagger Petstore", + author_email="apiteam@swagger.io", + url="", + keywords=["Swagger", "Swagger Petstore"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + """ +) diff --git a/samples/client/petstore/python/swagger_client/__init__.py b/samples/client/petstore/python/swagger_client/__init__.py new file mode 100644 index 00000000000..2d5ee4efbbe --- /dev/null +++ b/samples/client/petstore/python/swagger_client/__init__.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from swagger_client.api.animal_api import AnimalApi +from swagger_client.api.another_fake_api import AnotherFakeApi +from swagger_client.api.dog_api import DogApi +from swagger_client.api.fake_api import FakeApi +from swagger_client.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from swagger_client.api.pet_api import PetApi +from swagger_client.api.store_api import StoreApi +from swagger_client.api.user_api import UserApi +# import ApiClient +from swagger_client.api_client import ApiClient +from swagger_client.configuration import Configuration +# import models into sdk package +from swagger_client.models.additional_properties_class import AdditionalPropertiesClass +from swagger_client.models.all_pets_response import AllPetsResponse +from swagger_client.models.animal import Animal +from swagger_client.models.animal_farm import AnimalFarm +from swagger_client.models.api_response import ApiResponse +from swagger_client.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from swagger_client.models.array_of_number_only import ArrayOfNumberOnly +from swagger_client.models.array_test import ArrayTest +from swagger_client.models.body import Body +from swagger_client.models.body1 import Body1 +from swagger_client.models.body2 import Body2 +from swagger_client.models.body3 import Body3 +from swagger_client.models.body4 import Body4 +from swagger_client.models.body5 import Body5 +from swagger_client.models.body6 import Body6 +from swagger_client.models.body7 import Body7 +from swagger_client.models.capitalization import Capitalization +from swagger_client.models.cat import Cat +from swagger_client.models.category import Category +from swagger_client.models.class_model import ClassModel +from swagger_client.models.client import Client +from swagger_client.models.dog import Dog +from swagger_client.models.enum_arrays import EnumArrays +from swagger_client.models.enum_class import EnumClass +from swagger_client.models.enum_test import EnumTest +from swagger_client.models.format_test import FormatTest +from swagger_client.models.has_only_read_only import HasOnlyReadOnly +from swagger_client.models.list import List +from swagger_client.models.map_test import MapTest +from swagger_client.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from swagger_client.models.model200_response import Model200Response +from swagger_client.models.model_return import ModelReturn +from swagger_client.models.name import Name +from swagger_client.models.number_only import NumberOnly +from swagger_client.models.one_of_all_pets_response_items import OneOfAllPetsResponseItems +from swagger_client.models.one_of_single_pet_response_pet import OneOfSinglePetResponsePet +from swagger_client.models.order import Order +from swagger_client.models.outer_boolean import OuterBoolean +from swagger_client.models.outer_composite import OuterComposite +from swagger_client.models.outer_enum import OuterEnum +from swagger_client.models.outer_number import OuterNumber +from swagger_client.models.outer_string import OuterString +from swagger_client.models.pet import Pet +from swagger_client.models.read_only_first import ReadOnlyFirst +from swagger_client.models.single_pet_response import SinglePetResponse +from swagger_client.models.special_model_name import SpecialModelName +from swagger_client.models.tag import Tag +from swagger_client.models.user import User diff --git a/samples/client/petstore/python/swagger_client/api/__init__.py b/samples/client/petstore/python/swagger_client/api/__init__.py new file mode 100644 index 00000000000..3e5823cb1ef --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/__init__.py @@ -0,0 +1,13 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from swagger_client.api.animal_api import AnimalApi +from swagger_client.api.another_fake_api import AnotherFakeApi +from swagger_client.api.dog_api import DogApi +from swagger_client.api.fake_api import FakeApi +from swagger_client.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from swagger_client.api.pet_api import PetApi +from swagger_client.api.store_api import StoreApi +from swagger_client.api.user_api import UserApi diff --git a/samples/client/petstore/python/swagger_client/api/animal_api.py b/samples/client/petstore/python/swagger_client/api/animal_api.py new file mode 100644 index 00000000000..54dcce808b9 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/animal_api.py @@ -0,0 +1,508 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class AnimalApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_animal(self, body, **kwargs): # noqa: E501 + """Add a new animal to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_animal(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Animal body: Animal object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_animal_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_animal_with_http_info(body, **kwargs) # noqa: E501 + return data + + def add_animal_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new animal to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_animal_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Animal body: Animal object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_animal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_animal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/animal', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_animal(self, animal_id, **kwargs): # noqa: E501 + """Deletes a animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_animal(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: Animal id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_animal_with_http_info(animal_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_animal_with_http_info(animal_id, **kwargs) # noqa: E501 + return data + + def delete_animal_with_http_info(self, animal_id, **kwargs): # noqa: E501 + """Deletes a animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_animal_with_http_info(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: Animal id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['animal_id', 'api_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_animal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'animal_id' is set + if ('animal_id' not in params or + params['animal_id'] is None): + raise ValueError("Missing the required parameter `animal_id` when calling `delete_animal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'animal_id' in params: + path_params['animalId'] = params['animal_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/animal/{animalId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_animal_by_id(self, animal_id, **kwargs): # noqa: E501 + """Find animal by ID # noqa: E501 + + Returns a single animal # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_animal_by_id(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of pet to return (required) + :return: Animal + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_animal_by_id_with_http_info(animal_id, **kwargs) # noqa: E501 + else: + (data) = self.get_animal_by_id_with_http_info(animal_id, **kwargs) # noqa: E501 + return data + + def get_animal_by_id_with_http_info(self, animal_id, **kwargs): # noqa: E501 + """Find animal by ID # noqa: E501 + + Returns a single animal # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_animal_by_id_with_http_info(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of pet to return (required) + :return: Animal + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['animal_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_animal_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'animal_id' is set + if ('animal_id' not in params or + params['animal_id'] is None): + raise ValueError("Missing the required parameter `animal_id` when calling `get_animal_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'animal_id' in params: + path_params['animalId'] = params['animal_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/animal/{animalId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Animal', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_animal(self, body, **kwargs): # noqa: E501 + """Update an existing animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_animal(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Animal body: Animal object that needs to be added. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_animal_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_animal_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_animal_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_animal_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Animal body: Animal object that needs to be added. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_animal" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_animal`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/animal', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_animal_with_form(self, animal_id, **kwargs): # noqa: E501 + """Updates a animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_animal_with_form(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of animal that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_animal_with_form_with_http_info(animal_id, **kwargs) # noqa: E501 + else: + (data) = self.update_animal_with_form_with_http_info(animal_id, **kwargs) # noqa: E501 + return data + + def update_animal_with_form_with_http_info(self, animal_id, **kwargs): # noqa: E501 + """Updates a animal # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_animal_with_form_with_http_info(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of animal that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['animal_id', 'name', 'status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_animal_with_form" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'animal_id' is set + if ('animal_id' not in params or + params['animal_id'] is None): + raise ValueError("Missing the required parameter `animal_id` when calling `update_animal_with_form`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'animal_id' in params: + path_params['animalId'] = params['animal_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in params: + form_params.append(('name', params['name'])) # noqa: E501 + if 'status' in params: + form_params.append(('status', params['status'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/animal/{animalId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/another_fake_api.py b/samples/client/petstore/python/swagger_client/api/another_fake_api.py new file mode 100644 index 00000000000..7d01072df7f --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/another_fake_api.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_special_tags(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_special_tags(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_special_tags_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_special_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/another-fake/dummy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/dog_api.py b/samples/client/petstore/python/swagger_client/api/dog_api.py new file mode 100644 index 00000000000..bddd9cf5e1a --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/dog_api.py @@ -0,0 +1,508 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class DogApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_dog(self, body, **kwargs): # noqa: E501 + """Add a new dog to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dog(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Dog body: Dog object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_dog_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_dog_with_http_info(body, **kwargs) # noqa: E501 + return data + + def add_dog_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new dog to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_dog_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Dog body: Dog object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_dog" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_dog`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/dog', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_dog(self, dog_id, **kwargs): # noqa: E501 + """Deletes a dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_dog(dog_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int dog_id: Dog id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_dog_with_http_info(dog_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_dog_with_http_info(dog_id, **kwargs) # noqa: E501 + return data + + def delete_dog_with_http_info(self, dog_id, **kwargs): # noqa: E501 + """Deletes a dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_dog_with_http_info(dog_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int dog_id: Dog id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['dog_id', 'api_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_dog" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'dog_id' is set + if ('dog_id' not in params or + params['dog_id'] is None): + raise ValueError("Missing the required parameter `dog_id` when calling `delete_dog`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'dog_id' in params: + path_params['dogId'] = params['dog_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/dog/{dogId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_dog_by_id(self, dog_id, **kwargs): # noqa: E501 + """Find dog by ID # noqa: E501 + + Returns a single dog # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dog_by_id(dog_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int dog_id: ID of dog to return (required) + :return: Dog + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_dog_by_id_with_http_info(dog_id, **kwargs) # noqa: E501 + else: + (data) = self.get_dog_by_id_with_http_info(dog_id, **kwargs) # noqa: E501 + return data + + def get_dog_by_id_with_http_info(self, dog_id, **kwargs): # noqa: E501 + """Find dog by ID # noqa: E501 + + Returns a single dog # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_dog_by_id_with_http_info(dog_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int dog_id: ID of dog to return (required) + :return: Dog + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['dog_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_dog_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'dog_id' is set + if ('dog_id' not in params or + params['dog_id'] is None): + raise ValueError("Missing the required parameter `dog_id` when calling `get_dog_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'dog_id' in params: + path_params['dogId'] = params['dog_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/dog/{dogId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Dog', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_dog(self, body, **kwargs): # noqa: E501 + """Update an existing dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dog(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Dog body: Dog object that needs to be added. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_dog_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_dog_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_dog_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dog_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Dog body: Dog object that needs to be added. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_dog" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_dog`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/dog', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_dog_with_form(self, animal_id, **kwargs): # noqa: E501 + """Updates a dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dog_with_form(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of dog that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_dog_with_form_with_http_info(animal_id, **kwargs) # noqa: E501 + else: + (data) = self.update_dog_with_form_with_http_info(animal_id, **kwargs) # noqa: E501 + return data + + def update_dog_with_form_with_http_info(self, animal_id, **kwargs): # noqa: E501 + """Updates a dog # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_dog_with_form_with_http_info(animal_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int animal_id: ID of dog that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['animal_id', 'name', 'status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_dog_with_form" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'animal_id' is set + if ('animal_id' not in params or + params['animal_id'] is None): + raise ValueError("Missing the required parameter `animal_id` when calling `update_dog_with_form`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'animal_id' in params: + path_params['animalId'] = params['animal_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in params: + form_params.append(('name', params['name'])) # noqa: E501 + if 'status' in params: + form_params.append(('status', params['status'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/dog/{dogId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/fake_api.py b/samples/client/petstore/python/swagger_client/api/fake_api.py new file mode 100644 index 00000000000..76a6305d579 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/fake_api.py @@ -0,0 +1,989 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class FakeApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + return data + + def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param bool body: Input boolean as post body + :return: OuterBoolean + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_boolean_serialize" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/boolean', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterBoolean', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + return data + + def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OuterComposite body: Input composite as post body + :return: OuterComposite + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_composite_serialize" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/composite', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterComposite', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param float body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + return data + + def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param float body: Input number as post body + :return: OuterNumber + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_number_serialize" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/number', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterNumber', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + return data + + def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str body: Input string as post body + :return: OuterString + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_outer_string_serialize" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/outer/string', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OuterString', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_client_model(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_client_model" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_endpoint_parameters(self, body, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body2 body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_endpoint_parameters_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_endpoint_parameters_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_endpoint_parameters_with_http_info(self, body, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body2 body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_endpoint_parameters" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_endpoint_parameters`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/xml; charset=utf-8', 'application/json; charset=utf-8']) # noqa: E501 + + # Authentication setting + auth_settings = ['http_basic_test'] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + return data + + def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param list[str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['enum_header_string_array', 'enum_header_string', 'enum_query_string_array', 'enum_query_string', 'enum_query_integer'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_enum_parameters" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'enum_query_string_array' in params: + query_params.append(('enum_query_string_array', params['enum_query_string_array'])) # noqa: E501 + collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 + if 'enum_query_string' in params: + query_params.append(('enum_query_string', params['enum_query_string'])) # noqa: E501 + if 'enum_query_integer' in params: + query_params.append(('enum_query_integer', params['enum_query_integer'])) # noqa: E501 + + header_params = {} + if 'enum_header_string_array' in params: + header_params['enum_header_string_array'] = params['enum_header_string_array'] # noqa: E501 + collection_formats['enum_header_string_array'] = '' # noqa: E501 + if 'enum_header_string' in params: + header_params['enum_header_string'] = params['enum_header_string'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_enum_request_body(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_request_body(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body4 body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_enum_request_body_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.test_enum_request_body_with_http_info(**kwargs) # noqa: E501 + return data + + def test_enum_request_body_with_http_info(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_request_body_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body4 body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_enum_request_body" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/enum/form', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_inline_additional_properties(self, body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, str) body: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_inline_additional_properties_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_inline_additional_properties_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_inline_additional_properties_with_http_info(self, body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param dict(str, str) body: request body (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_inline_additional_properties" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_inline_additional_properties`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/inline-additionalProperties', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def test_json_form_data(self, body, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body5 body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_json_form_data_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_json_form_data_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_json_form_data_with_http_info(self, body, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Body5 body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_json_form_data" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_json_form_data`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/jsonFormData', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/swagger_client/api/fake_classname_tags_123_api.py new file mode 100644 index 00000000000..9ac46705400 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/fake_classname_tags_123_api.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def test_classname(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + return data + + def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Client body: client model (required) + :return: Client + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method test_classname" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key_query'] # noqa: E501 + + return self.api_client.call_api( + '/fake_classname_test', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Client', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/pet_api.py b/samples/client/petstore/python/swagger_client/api/pet_api.py new file mode 100644 index 00000000000..8573ea5e78a --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/pet_api.py @@ -0,0 +1,975 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class PetApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def add_pet(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + return data + + def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + else: + (data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + return data + + def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] status: Status values that need to be considered for filter (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'status' is set + if ('status' not in params or + params['status'] is None): + raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'status' in params: + query_params.append(('status', params['status'])) # noqa: E501 + collection_formats['status'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/findByStatus', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + else: + (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + return data + + def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[str] tags: Tags to filter by (required) + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tags'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_pets_by_tags" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tags' is set + if ('tags' not in params or + params['tags'] is None): + raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'tags' in params: + query_params.append(('tags', params['tags'])) # noqa: E501 + collection_formats['tags'] = 'csv' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/findByTags', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Pet]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_all_pets(self, **kwargs): # noqa: E501 + """get_all_pets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_pets(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: AllPetsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_all_pets_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_all_pets_with_http_info(**kwargs) # noqa: E501 + return data + + def get_all_pets_with_http_info(self, **kwargs): # noqa: E501 + """get_all_pets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_all_pets_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: AllPetsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_pets" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/allPets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AllPetsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + return data + + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet to return (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Pet', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_random_pet(self, **kwargs): # noqa: E501 + """get_random_pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_random_pet(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: SinglePetResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_random_pet_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_random_pet_with_http_info(**kwargs) # noqa: E501 + return data + + def get_random_pet_with_http_info(self, **kwargs): # noqa: E501 + """get_random_pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_random_pet_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: SinglePetResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_random_pet" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/randomPet', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SinglePetResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + return data + + def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Pet body: Pet object that needs to be added to the store (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + return data + + def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: + :param str status: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'name', 'status'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet_with_form" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'name' in params: + form_params.append(('name', params['name'])) # noqa: E501 + if 'status' in params: + form_params.append(('status', params['status'])) # noqa: E501 + + body_params = None + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/x-www-form-urlencoded']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: + :param str file: + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + return data + + def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: + :param str file: + :return: ApiResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'additional_metadata', 'file'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method upload_file" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params or + params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + if 'additional_metadata' in params: + form_params.append(('additionalMetadata', params['additional_metadata'])) # noqa: E501 + if 'file' in params: + local_var_files['file'] = params['file'] # noqa: E501 + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['multipart/form-data']) # noqa: E501 + + # Authentication setting + auth_settings = ['petstore_auth'] # noqa: E501 + + return self.api_client.call_api( + '/pet/{petId}/uploadImage', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ApiResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/store_api.py b/samples/client/petstore/python/swagger_client/api/store_api.py new file mode 100644 index 00000000000..8a30dfa393b --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/store_api.py @@ -0,0 +1,403 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class StoreApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + return data + + def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params or + params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order/{order_id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 + return data + + def get_inventory_with_http_info(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_inventory" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/store/inventory', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, int)', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + else: + (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + return data + + def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_order_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params or + params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in params: + path_params['order_id'] = params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order/{order_id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def place_order(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.place_order_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 + return data + + def place_order_with_http_info(self, body, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Order body: order placed for purchasing the pet (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method place_order" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/store/order', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Order', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api/user_api.py b/samples/client/petstore/python/swagger_client/api/user_api.py new file mode 100644 index 00000000000..d2355b15982 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api/user_api.py @@ -0,0 +1,783 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class UserApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_user(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_user_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_user_with_http_info(self, body, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param User body: Created user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_array_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_array_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/createWithArray', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def create_users_with_list_input(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + return data + + def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[User] body: List of user object (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method create_users_with_list_input" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/createWithList', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + else: + (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + return data + + def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user_with_http_info(username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + else: + (data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + else: + (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + return data + + def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user_with_http_info(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username', 'password'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method login_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 + # verify the required parameter 'password' is set + if ('password' not in params or + params['password'] is None): + raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'username' in params: + query_params.append(('username', params['username'])) # noqa: E501 + if 'password' in params: + query_params.append(('password', params['password'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/xml', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/login', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.logout_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 + return data + + def logout_user_with_http_info(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method logout_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/logout', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_user(self, body, username, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(body, username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param User body: Updated user object (required) + :param str username: name that need to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_user_with_http_info(body, username, **kwargs) # noqa: E501 + else: + (data) = self.update_user_with_http_info(body, username, **kwargs) # noqa: E501 + return data + + def update_user_with_http_info(self, body, username, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user_with_http_info(body, username, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param User body: Updated user object (required) + :param str username: name that need to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'username'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_user" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/{username}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py new file mode 100644 index 00000000000..8cb84d3de87 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/api_client.py @@ -0,0 +1,628 @@ +# coding: utf-8 +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from swagger_client.configuration import Configuration +import swagger_client.models +from swagger_client import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(swagger_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :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 async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/samples/client/petstore/python/swagger_client/configuration.py b/samples/client/petstore/python/swagger_client/configuration.py new file mode 100644 index 00000000000..27c3226c451 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/configuration.py @@ -0,0 +1,267 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "http://petstore.swagger.io:80/v2" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # access token for OAuth + self.access_token = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("swagger_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/samples/client/petstore/python/swagger_client/models/__init__.py b/samples/client/petstore/python/swagger_client/models/__init__.py new file mode 100644 index 00000000000..4d0f6fd8a15 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/__init__.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +# flake8: noqa +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from swagger_client.models.additional_properties_class import AdditionalPropertiesClass +from swagger_client.models.all_pets_response import AllPetsResponse +from swagger_client.models.animal import Animal +from swagger_client.models.animal_farm import AnimalFarm +from swagger_client.models.api_response import ApiResponse +from swagger_client.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from swagger_client.models.array_of_number_only import ArrayOfNumberOnly +from swagger_client.models.array_test import ArrayTest +from swagger_client.models.body import Body +from swagger_client.models.body1 import Body1 +from swagger_client.models.body2 import Body2 +from swagger_client.models.body3 import Body3 +from swagger_client.models.body4 import Body4 +from swagger_client.models.body5 import Body5 +from swagger_client.models.body6 import Body6 +from swagger_client.models.body7 import Body7 +from swagger_client.models.capitalization import Capitalization +from swagger_client.models.cat import Cat +from swagger_client.models.category import Category +from swagger_client.models.class_model import ClassModel +from swagger_client.models.client import Client +from swagger_client.models.dog import Dog +from swagger_client.models.enum_arrays import EnumArrays +from swagger_client.models.enum_class import EnumClass +from swagger_client.models.enum_test import EnumTest +from swagger_client.models.format_test import FormatTest +from swagger_client.models.has_only_read_only import HasOnlyReadOnly +from swagger_client.models.list import List +from swagger_client.models.map_test import MapTest +from swagger_client.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from swagger_client.models.model200_response import Model200Response +from swagger_client.models.model_return import ModelReturn +from swagger_client.models.name import Name +from swagger_client.models.number_only import NumberOnly +from swagger_client.models.one_of_all_pets_response_items import OneOfAllPetsResponseItems +from swagger_client.models.one_of_single_pet_response_pet import OneOfSinglePetResponsePet +from swagger_client.models.order import Order +from swagger_client.models.outer_boolean import OuterBoolean +from swagger_client.models.outer_composite import OuterComposite +from swagger_client.models.outer_enum import OuterEnum +from swagger_client.models.outer_number import OuterNumber +from swagger_client.models.outer_string import OuterString +from swagger_client.models.pet import Pet +from swagger_client.models.read_only_first import ReadOnlyFirst +from swagger_client.models.single_pet_response import SinglePetResponse +from swagger_client.models.special_model_name import SpecialModelName +from swagger_client.models.tag import Tag +from swagger_client.models.user import User diff --git a/samples/client/petstore/python/swagger_client/models/additional_properties_class.py b/samples/client/petstore/python/swagger_client/models/additional_properties_class.py new file mode 100644 index 00000000000..c71eb761695 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/additional_properties_class.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class AdditionalPropertiesClass(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_property': 'dict(str, str)', + 'map_of_map_property': 'dict(str, dict(str, str))' + } + + attribute_map = { + 'map_property': 'map_property', + 'map_of_map_property': 'map_of_map_property' + } + + def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 + self._map_property = None + self._map_of_map_property = None + self.discriminator = None + if map_property is not None: + self.map_property = map_property + if map_of_map_property is not None: + self.map_of_map_property = map_of_map_property + + @property + def map_property(self): + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_property of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, str) + """ + return self._map_property + + @map_property.setter + def map_property(self, map_property): + """Sets the map_property of this AdditionalPropertiesClass. + + + :param map_property: The map_property of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, str) + """ + + self._map_property = map_property + + @property + def map_of_map_property(self): + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + + + :return: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, dict(str, str)) + """ + return self._map_of_map_property + + @map_of_map_property.setter + def map_of_map_property(self, map_of_map_property): + """Sets the map_of_map_property of this AdditionalPropertiesClass. + + + :param map_of_map_property: The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + :type: dict(str, dict(str, str)) + """ + + self._map_of_map_property = map_of_map_property + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/all_pets_response.py b/samples/client/petstore/python/swagger_client/models/all_pets_response.py new file mode 100644 index 00000000000..3171c75f7e3 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/all_pets_response.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class AllPetsResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AllPetsResponse - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AllPetsResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AllPetsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/animal.py b/samples/client/petstore/python/swagger_client/models/animal.py new file mode 100644 index 00000000000..0b14711562e --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/animal.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Animal(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color' + } + + discriminator_value_class_map = { + } + + def __init__(self, class_name=None, color='red'): # noqa: E501 + """Animal - a model defined in Swagger""" # noqa: E501 + self._class_name = None + self._color = None + self.discriminator = 'className' + self.class_name = class_name + if color is not None: + self.color = color + + @property + def class_name(self): + """Gets the class_name of this Animal. # noqa: E501 + + + :return: The class_name of this Animal. # noqa: E501 + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """Sets the class_name of this Animal. + + + :param class_name: The class_name of this Animal. # noqa: E501 + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 + + self._class_name = class_name + + @property + def color(self): + """Gets the color of this Animal. # noqa: E501 + + + :return: The color of this Animal. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this Animal. + + + :param color: The color of this Animal. # noqa: E501 + :type: str + """ + + self._color = color + + def get_real_child_model(self, data): + """Returns the real base class specified by the discriminator""" + discriminator_value = data[self.discriminator].lower() + return self.discriminator_value_class_map.get(discriminator_value) + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Animal, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Animal): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/animal_farm.py b/samples/client/petstore/python/swagger_client/models/animal_farm.py new file mode 100644 index 00000000000..c2600c9921d --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/animal_farm.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class AnimalFarm(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AnimalFarm - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AnimalFarm, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AnimalFarm): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/api_response.py b/samples/client/petstore/python/swagger_client/models/api_response.py new file mode 100644 index 00000000000..527766b7d8f --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/api_response.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ApiResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'type': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'type': 'type', + 'message': 'message' + } + + def __init__(self, code=None, type=None, message=None): # noqa: E501 + """ApiResponse - a model defined in Swagger""" # noqa: E501 + self._code = None + self._type = None + self._message = None + self.discriminator = None + if code is not None: + self.code = code + if type is not None: + self.type = type + if message is not None: + self.message = message + + @property + def code(self): + """Gets the code of this ApiResponse. # noqa: E501 + + + :return: The code of this ApiResponse. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiResponse. + + + :param code: The code of this ApiResponse. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def type(self): + """Gets the type of this ApiResponse. # noqa: E501 + + + :return: The type of this ApiResponse. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ApiResponse. + + + :param type: The type of this ApiResponse. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def message(self): + """Gets the message of this ApiResponse. # noqa: E501 + + + :return: The message of this ApiResponse. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiResponse. + + + :param message: The message of this ApiResponse. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ApiResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/array_of_array_of_number_only.py b/samples/client/petstore/python/swagger_client/models/array_of_array_of_number_only.py new file mode 100644 index 00000000000..aeb09448e0f --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/array_of_array_of_number_only.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ArrayOfArrayOfNumberOnly(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_array_number': 'list[list[float]]' + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' + } + + def __init__(self, array_array_number=None): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 + self._array_array_number = None + self.discriminator = None + if array_array_number is not None: + self.array_array_number = array_array_number + + @property + def array_array_number(self): + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + + + :return: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + :rtype: list[list[float]] + """ + return self._array_array_number + + @array_array_number.setter + def array_array_number(self, array_array_number): + """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. + + + :param array_array_number: The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + :type: list[list[float]] + """ + + self._array_array_number = array_array_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ArrayOfArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/array_of_number_only.py b/samples/client/petstore/python/swagger_client/models/array_of_number_only.py new file mode 100644 index 00000000000..32ad20acb66 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/array_of_number_only.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ArrayOfNumberOnly(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_number': 'list[float]' + } + + attribute_map = { + 'array_number': 'ArrayNumber' + } + + def __init__(self, array_number=None): # noqa: E501 + """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 + self._array_number = None + self.discriminator = None + if array_number is not None: + self.array_number = array_number + + @property + def array_number(self): + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 + + + :return: The array_number of this ArrayOfNumberOnly. # noqa: E501 + :rtype: list[float] + """ + return self._array_number + + @array_number.setter + def array_number(self, array_number): + """Sets the array_number of this ArrayOfNumberOnly. + + + :param array_number: The array_number of this ArrayOfNumberOnly. # noqa: E501 + :type: list[float] + """ + + self._array_number = array_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ArrayOfNumberOnly, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfNumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/array_test.py b/samples/client/petstore/python/swagger_client/models/array_test.py new file mode 100644 index 00000000000..e297c4a08a5 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/array_test.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ArrayTest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'array_of_string': 'list[str]', + 'array_array_of_integer': 'list[list[int]]', + 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + } + + attribute_map = { + 'array_of_string': 'array_of_string', + 'array_array_of_integer': 'array_array_of_integer', + 'array_array_of_model': 'array_array_of_model' + } + + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + """ArrayTest - a model defined in Swagger""" # noqa: E501 + self._array_of_string = None + self._array_array_of_integer = None + self._array_array_of_model = None + self.discriminator = None + if array_of_string is not None: + self.array_of_string = array_of_string + if array_array_of_integer is not None: + self.array_array_of_integer = array_array_of_integer + if array_array_of_model is not None: + self.array_array_of_model = array_array_of_model + + @property + def array_of_string(self): + """Gets the array_of_string of this ArrayTest. # noqa: E501 + + + :return: The array_of_string of this ArrayTest. # noqa: E501 + :rtype: list[str] + """ + return self._array_of_string + + @array_of_string.setter + def array_of_string(self, array_of_string): + """Sets the array_of_string of this ArrayTest. + + + :param array_of_string: The array_of_string of this ArrayTest. # noqa: E501 + :type: list[str] + """ + + self._array_of_string = array_of_string + + @property + def array_array_of_integer(self): + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 + + + :return: The array_array_of_integer of this ArrayTest. # noqa: E501 + :rtype: list[list[int]] + """ + return self._array_array_of_integer + + @array_array_of_integer.setter + def array_array_of_integer(self, array_array_of_integer): + """Sets the array_array_of_integer of this ArrayTest. + + + :param array_array_of_integer: The array_array_of_integer of this ArrayTest. # noqa: E501 + :type: list[list[int]] + """ + + self._array_array_of_integer = array_array_of_integer + + @property + def array_array_of_model(self): + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 + + + :return: The array_array_of_model of this ArrayTest. # noqa: E501 + :rtype: list[list[ReadOnlyFirst]] + """ + return self._array_array_of_model + + @array_array_of_model.setter + def array_array_of_model(self, array_array_of_model): + """Sets the array_array_of_model of this ArrayTest. + + + :param array_array_of_model: The array_array_of_model of this ArrayTest. # noqa: E501 + :type: list[list[ReadOnlyFirst]] + """ + + self._array_array_of_model = array_array_of_model + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ArrayTest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body.py b/samples/client/petstore/python/swagger_client/models/body.py new file mode 100644 index 00000000000..f56e4b4b9df --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'status': 'str' + } + + attribute_map = { + 'name': 'name', + 'status': 'status' + } + + def __init__(self, name=None, status=None): # noqa: E501 + """Body - a model defined in Swagger""" # noqa: E501 + self._name = None + self._status = None + self.discriminator = None + if name is not None: + self.name = name + if status is not None: + self.status = status + + @property + def name(self): + """Gets the name of this Body. # noqa: E501 + + Updated name of the pet # noqa: E501 + + :return: The name of this Body. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Body. + + Updated name of the pet # noqa: E501 + + :param name: The name of this Body. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def status(self): + """Gets the status of this Body. # noqa: E501 + + Updated status of the pet # noqa: E501 + + :return: The status of this Body. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Body. + + Updated status of the pet # noqa: E501 + + :param status: The status of this Body. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body1.py b/samples/client/petstore/python/swagger_client/models/body1.py new file mode 100644 index 00000000000..e0c0f7d950c --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body1.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body1(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'additional_metadata': 'str', + 'file': 'str' + } + + attribute_map = { + 'additional_metadata': 'additionalMetadata', + 'file': 'file' + } + + def __init__(self, additional_metadata=None, file=None): # noqa: E501 + """Body1 - a model defined in Swagger""" # noqa: E501 + self._additional_metadata = None + self._file = None + self.discriminator = None + if additional_metadata is not None: + self.additional_metadata = additional_metadata + if file is not None: + self.file = file + + @property + def additional_metadata(self): + """Gets the additional_metadata of this Body1. # noqa: E501 + + Additional data to pass to server # noqa: E501 + + :return: The additional_metadata of this Body1. # noqa: E501 + :rtype: str + """ + return self._additional_metadata + + @additional_metadata.setter + def additional_metadata(self, additional_metadata): + """Sets the additional_metadata of this Body1. + + Additional data to pass to server # noqa: E501 + + :param additional_metadata: The additional_metadata of this Body1. # noqa: E501 + :type: str + """ + + self._additional_metadata = additional_metadata + + @property + def file(self): + """Gets the file of this Body1. # noqa: E501 + + file to upload # noqa: E501 + + :return: The file of this Body1. # noqa: E501 + :rtype: str + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this Body1. + + file to upload # noqa: E501 + + :param file: The file of this Body1. # noqa: E501 + :type: str + """ + + self._file = file + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body1, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body1): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body2.py b/samples/client/petstore/python/swagger_client/models/body2.py new file mode 100644 index 00000000000..d76239444ce --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body2.py @@ -0,0 +1,481 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body2(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + '_float': 'float', + 'double': 'float', + 'string': 'str', + 'pattern_without_delimiter': 'str', + 'byte': 'str', + 'binary': 'str', + '_date': 'date', + 'date_time': 'datetime', + 'password': 'str', + 'callback': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + '_float': 'float', + 'double': 'double', + 'string': 'string', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'binary': 'binary', + '_date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'callback': 'callback' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, _date=None, date_time=None, password=None, callback=None): # noqa: E501 + """Body2 - a model defined in Swagger""" # noqa: E501 + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self.__float = None + self._double = None + self._string = None + self._pattern_without_delimiter = None + self._byte = None + self._binary = None + self.__date = None + self._date_time = None + self._password = None + self._callback = None + self.discriminator = None + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if _float is not None: + self._float = _float + self.double = double + if string is not None: + self.string = string + self.pattern_without_delimiter = pattern_without_delimiter + self.byte = byte + if binary is not None: + self.binary = binary + if _date is not None: + self._date = _date + if date_time is not None: + self.date_time = date_time + if password is not None: + self.password = password + if callback is not None: + self.callback = callback + + @property + def integer(self): + """Gets the integer of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The integer of this Body2. # noqa: E501 + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """Sets the integer of this Body2. + + None # noqa: E501 + + :param integer: The integer of this Body2. # noqa: E501 + :type: int + """ + + self._integer = integer + + @property + def int32(self): + """Gets the int32 of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The int32 of this Body2. # noqa: E501 + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """Sets the int32 of this Body2. + + None # noqa: E501 + + :param int32: The int32 of this Body2. # noqa: E501 + :type: int + """ + + self._int32 = int32 + + @property + def int64(self): + """Gets the int64 of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The int64 of this Body2. # noqa: E501 + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """Sets the int64 of this Body2. + + None # noqa: E501 + + :param int64: The int64 of this Body2. # noqa: E501 + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """Gets the number of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The number of this Body2. # noqa: E501 + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this Body2. + + None # noqa: E501 + + :param number: The number of this Body2. # noqa: E501 + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + + self._number = number + + @property + def _float(self): + """Gets the _float of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The _float of this Body2. # noqa: E501 + :rtype: float + """ + return self.__float + + @_float.setter + def _float(self, _float): + """Sets the _float of this Body2. + + None # noqa: E501 + + :param _float: The _float of this Body2. # noqa: E501 + :type: float + """ + + self.__float = _float + + @property + def double(self): + """Gets the double of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The double of this Body2. # noqa: E501 + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """Sets the double of this Body2. + + None # noqa: E501 + + :param double: The double of this Body2. # noqa: E501 + :type: float + """ + if double is None: + raise ValueError("Invalid value for `double`, must not be `None`") # noqa: E501 + + self._double = double + + @property + def string(self): + """Gets the string of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The string of this Body2. # noqa: E501 + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """Sets the string of this Body2. + + None # noqa: E501 + + :param string: The string of this Body2. # noqa: E501 + :type: str + """ + + self._string = string + + @property + def pattern_without_delimiter(self): + """Gets the pattern_without_delimiter of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The pattern_without_delimiter of this Body2. # noqa: E501 + :rtype: str + """ + return self._pattern_without_delimiter + + @pattern_without_delimiter.setter + def pattern_without_delimiter(self, pattern_without_delimiter): + """Sets the pattern_without_delimiter of this Body2. + + None # noqa: E501 + + :param pattern_without_delimiter: The pattern_without_delimiter of this Body2. # noqa: E501 + :type: str + """ + if pattern_without_delimiter is None: + raise ValueError("Invalid value for `pattern_without_delimiter`, must not be `None`") # noqa: E501 + + self._pattern_without_delimiter = pattern_without_delimiter + + @property + def byte(self): + """Gets the byte of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The byte of this Body2. # noqa: E501 + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """Sets the byte of this Body2. + + None # noqa: E501 + + :param byte: The byte of this Body2. # noqa: E501 + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 + + self._byte = byte + + @property + def binary(self): + """Gets the binary of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The binary of this Body2. # noqa: E501 + :rtype: str + """ + return self._binary + + @binary.setter + def binary(self, binary): + """Sets the binary of this Body2. + + None # noqa: E501 + + :param binary: The binary of this Body2. # noqa: E501 + :type: str + """ + + self._binary = binary + + @property + def _date(self): + """Gets the _date of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The _date of this Body2. # noqa: E501 + :rtype: date + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this Body2. + + None # noqa: E501 + + :param _date: The _date of this Body2. # noqa: E501 + :type: date + """ + + self.__date = _date + + @property + def date_time(self): + """Gets the date_time of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The date_time of this Body2. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this Body2. + + None # noqa: E501 + + :param date_time: The date_time of this Body2. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def password(self): + """Gets the password of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The password of this Body2. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this Body2. + + None # noqa: E501 + + :param password: The password of this Body2. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def callback(self): + """Gets the callback of this Body2. # noqa: E501 + + None # noqa: E501 + + :return: The callback of this Body2. # noqa: E501 + :rtype: str + """ + return self._callback + + @callback.setter + def callback(self, callback): + """Sets the callback of this Body2. + + None # noqa: E501 + + :param callback: The callback of this Body2. # noqa: E501 + :type: str + """ + + self._callback = callback + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body2, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body2): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body3.py b/samples/client/petstore/python/swagger_client/models/body3.py new file mode 100644 index 00000000000..792f35bb9ee --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body3.py @@ -0,0 +1,481 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body3(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + '_float': 'float', + 'double': 'float', + 'string': 'str', + 'pattern_without_delimiter': 'str', + 'byte': 'str', + 'binary': 'str', + '_date': 'date', + 'date_time': 'datetime', + 'password': 'str', + 'callback': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + '_float': 'float', + 'double': 'double', + 'string': 'string', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'binary': 'binary', + '_date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'callback': 'callback' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, _date=None, date_time=None, password=None, callback=None): # noqa: E501 + """Body3 - a model defined in Swagger""" # noqa: E501 + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self.__float = None + self._double = None + self._string = None + self._pattern_without_delimiter = None + self._byte = None + self._binary = None + self.__date = None + self._date_time = None + self._password = None + self._callback = None + self.discriminator = None + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if _float is not None: + self._float = _float + self.double = double + if string is not None: + self.string = string + self.pattern_without_delimiter = pattern_without_delimiter + self.byte = byte + if binary is not None: + self.binary = binary + if _date is not None: + self._date = _date + if date_time is not None: + self.date_time = date_time + if password is not None: + self.password = password + if callback is not None: + self.callback = callback + + @property + def integer(self): + """Gets the integer of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The integer of this Body3. # noqa: E501 + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """Sets the integer of this Body3. + + None # noqa: E501 + + :param integer: The integer of this Body3. # noqa: E501 + :type: int + """ + + self._integer = integer + + @property + def int32(self): + """Gets the int32 of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The int32 of this Body3. # noqa: E501 + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """Sets the int32 of this Body3. + + None # noqa: E501 + + :param int32: The int32 of this Body3. # noqa: E501 + :type: int + """ + + self._int32 = int32 + + @property + def int64(self): + """Gets the int64 of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The int64 of this Body3. # noqa: E501 + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """Sets the int64 of this Body3. + + None # noqa: E501 + + :param int64: The int64 of this Body3. # noqa: E501 + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """Gets the number of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The number of this Body3. # noqa: E501 + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this Body3. + + None # noqa: E501 + + :param number: The number of this Body3. # noqa: E501 + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + + self._number = number + + @property + def _float(self): + """Gets the _float of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The _float of this Body3. # noqa: E501 + :rtype: float + """ + return self.__float + + @_float.setter + def _float(self, _float): + """Sets the _float of this Body3. + + None # noqa: E501 + + :param _float: The _float of this Body3. # noqa: E501 + :type: float + """ + + self.__float = _float + + @property + def double(self): + """Gets the double of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The double of this Body3. # noqa: E501 + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """Sets the double of this Body3. + + None # noqa: E501 + + :param double: The double of this Body3. # noqa: E501 + :type: float + """ + if double is None: + raise ValueError("Invalid value for `double`, must not be `None`") # noqa: E501 + + self._double = double + + @property + def string(self): + """Gets the string of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The string of this Body3. # noqa: E501 + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """Sets the string of this Body3. + + None # noqa: E501 + + :param string: The string of this Body3. # noqa: E501 + :type: str + """ + + self._string = string + + @property + def pattern_without_delimiter(self): + """Gets the pattern_without_delimiter of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The pattern_without_delimiter of this Body3. # noqa: E501 + :rtype: str + """ + return self._pattern_without_delimiter + + @pattern_without_delimiter.setter + def pattern_without_delimiter(self, pattern_without_delimiter): + """Sets the pattern_without_delimiter of this Body3. + + None # noqa: E501 + + :param pattern_without_delimiter: The pattern_without_delimiter of this Body3. # noqa: E501 + :type: str + """ + if pattern_without_delimiter is None: + raise ValueError("Invalid value for `pattern_without_delimiter`, must not be `None`") # noqa: E501 + + self._pattern_without_delimiter = pattern_without_delimiter + + @property + def byte(self): + """Gets the byte of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The byte of this Body3. # noqa: E501 + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """Sets the byte of this Body3. + + None # noqa: E501 + + :param byte: The byte of this Body3. # noqa: E501 + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 + + self._byte = byte + + @property + def binary(self): + """Gets the binary of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The binary of this Body3. # noqa: E501 + :rtype: str + """ + return self._binary + + @binary.setter + def binary(self, binary): + """Sets the binary of this Body3. + + None # noqa: E501 + + :param binary: The binary of this Body3. # noqa: E501 + :type: str + """ + + self._binary = binary + + @property + def _date(self): + """Gets the _date of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The _date of this Body3. # noqa: E501 + :rtype: date + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this Body3. + + None # noqa: E501 + + :param _date: The _date of this Body3. # noqa: E501 + :type: date + """ + + self.__date = _date + + @property + def date_time(self): + """Gets the date_time of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The date_time of this Body3. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this Body3. + + None # noqa: E501 + + :param date_time: The date_time of this Body3. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def password(self): + """Gets the password of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The password of this Body3. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this Body3. + + None # noqa: E501 + + :param password: The password of this Body3. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def callback(self): + """Gets the callback of this Body3. # noqa: E501 + + None # noqa: E501 + + :return: The callback of this Body3. # noqa: E501 + :rtype: str + """ + return self._callback + + @callback.setter + def callback(self, callback): + """Sets the callback of this Body3. + + None # noqa: E501 + + :param callback: The callback of this Body3. # noqa: E501 + :type: str + """ + + self._callback = callback + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body3, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body3): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body4.py b/samples/client/petstore/python/swagger_client/models/body4.py new file mode 100644 index 00000000000..22ff8844766 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body4.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body4(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enum_form_string_array': 'list[str]', + 'enum_form_string': 'str', + 'enum_query_double': 'float' + } + + attribute_map = { + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + 'enum_query_double': 'enum_query_double' + } + + def __init__(self, enum_form_string_array=None, enum_form_string='-efg', enum_query_double=None): # noqa: E501 + """Body4 - a model defined in Swagger""" # noqa: E501 + self._enum_form_string_array = None + self._enum_form_string = None + self._enum_query_double = None + self.discriminator = None + if enum_form_string_array is not None: + self.enum_form_string_array = enum_form_string_array + if enum_form_string is not None: + self.enum_form_string = enum_form_string + if enum_query_double is not None: + self.enum_query_double = enum_query_double + + @property + def enum_form_string_array(self): + """Gets the enum_form_string_array of this Body4. # noqa: E501 + + Form parameter enum test (string array) # noqa: E501 + + :return: The enum_form_string_array of this Body4. # noqa: E501 + :rtype: list[str] + """ + return self._enum_form_string_array + + @enum_form_string_array.setter + def enum_form_string_array(self, enum_form_string_array): + """Sets the enum_form_string_array of this Body4. + + Form parameter enum test (string array) # noqa: E501 + + :param enum_form_string_array: The enum_form_string_array of this Body4. # noqa: E501 + :type: list[str] + """ + allowed_values = [">", "$"] # noqa: E501 + if not set(enum_form_string_array).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(enum_form_string_array) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._enum_form_string_array = enum_form_string_array + + @property + def enum_form_string(self): + """Gets the enum_form_string of this Body4. # noqa: E501 + + Form parameter enum test (string) # noqa: E501 + + :return: The enum_form_string of this Body4. # noqa: E501 + :rtype: str + """ + return self._enum_form_string + + @enum_form_string.setter + def enum_form_string(self, enum_form_string): + """Sets the enum_form_string of this Body4. + + Form parameter enum test (string) # noqa: E501 + + :param enum_form_string: The enum_form_string of this Body4. # noqa: E501 + :type: str + """ + allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 + if enum_form_string not in allowed_values: + raise ValueError( + "Invalid value for `enum_form_string` ({0}), must be one of {1}" # noqa: E501 + .format(enum_form_string, allowed_values) + ) + + self._enum_form_string = enum_form_string + + @property + def enum_query_double(self): + """Gets the enum_query_double of this Body4. # noqa: E501 + + Query parameter enum test (double) # noqa: E501 + + :return: The enum_query_double of this Body4. # noqa: E501 + :rtype: float + """ + return self._enum_query_double + + @enum_query_double.setter + def enum_query_double(self, enum_query_double): + """Sets the enum_query_double of this Body4. + + Query parameter enum test (double) # noqa: E501 + + :param enum_query_double: The enum_query_double of this Body4. # noqa: E501 + :type: float + """ + allowed_values = [1.1, -1.2] # noqa: E501 + if enum_query_double not in allowed_values: + raise ValueError( + "Invalid value for `enum_query_double` ({0}), must be one of {1}" # noqa: E501 + .format(enum_query_double, allowed_values) + ) + + self._enum_query_double = enum_query_double + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body4, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body4): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body5.py b/samples/client/petstore/python/swagger_client/models/body5.py new file mode 100644 index 00000000000..ed30e2263be --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body5.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body5(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'param': 'str', + 'param2': 'str' + } + + attribute_map = { + 'param': 'param', + 'param2': 'param2' + } + + def __init__(self, param=None, param2=None): # noqa: E501 + """Body5 - a model defined in Swagger""" # noqa: E501 + self._param = None + self._param2 = None + self.discriminator = None + self.param = param + self.param2 = param2 + + @property + def param(self): + """Gets the param of this Body5. # noqa: E501 + + field1 # noqa: E501 + + :return: The param of this Body5. # noqa: E501 + :rtype: str + """ + return self._param + + @param.setter + def param(self, param): + """Sets the param of this Body5. + + field1 # noqa: E501 + + :param param: The param of this Body5. # noqa: E501 + :type: str + """ + if param is None: + raise ValueError("Invalid value for `param`, must not be `None`") # noqa: E501 + + self._param = param + + @property + def param2(self): + """Gets the param2 of this Body5. # noqa: E501 + + field2 # noqa: E501 + + :return: The param2 of this Body5. # noqa: E501 + :rtype: str + """ + return self._param2 + + @param2.setter + def param2(self, param2): + """Sets the param2 of this Body5. + + field2 # noqa: E501 + + :param param2: The param2 of this Body5. # noqa: E501 + :type: str + """ + if param2 is None: + raise ValueError("Invalid value for `param2`, must not be `None`") # noqa: E501 + + self._param2 = param2 + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body5, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body5): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body6.py b/samples/client/petstore/python/swagger_client/models/body6.py new file mode 100644 index 00000000000..e648d53d601 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body6.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body6(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'status': 'str' + } + + attribute_map = { + 'name': 'name', + 'status': 'status' + } + + def __init__(self, name=None, status=None): # noqa: E501 + """Body6 - a model defined in Swagger""" # noqa: E501 + self._name = None + self._status = None + self.discriminator = None + if name is not None: + self.name = name + if status is not None: + self.status = status + + @property + def name(self): + """Gets the name of this Body6. # noqa: E501 + + Updated name of the animal # noqa: E501 + + :return: The name of this Body6. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Body6. + + Updated name of the animal # noqa: E501 + + :param name: The name of this Body6. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def status(self): + """Gets the status of this Body6. # noqa: E501 + + Updated status of the animal # noqa: E501 + + :return: The status of this Body6. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Body6. + + Updated status of the animal # noqa: E501 + + :param status: The status of this Body6. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body6, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body6): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/body7.py b/samples/client/petstore/python/swagger_client/models/body7.py new file mode 100644 index 00000000000..d2e8f433145 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/body7.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Body7(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'status': 'str' + } + + attribute_map = { + 'name': 'name', + 'status': 'status' + } + + def __init__(self, name=None, status=None): # noqa: E501 + """Body7 - a model defined in Swagger""" # noqa: E501 + self._name = None + self._status = None + self.discriminator = None + if name is not None: + self.name = name + if status is not None: + self.status = status + + @property + def name(self): + """Gets the name of this Body7. # noqa: E501 + + Updated name of the dog # noqa: E501 + + :return: The name of this Body7. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Body7. + + Updated name of the dog # noqa: E501 + + :param name: The name of this Body7. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def status(self): + """Gets the status of this Body7. # noqa: E501 + + Updated status of the dog # noqa: E501 + + :return: The status of this Body7. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Body7. + + Updated status of the dog # noqa: E501 + + :param status: The status of this Body7. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Body7, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Body7): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/capitalization.py b/samples/client/petstore/python/swagger_client/models/capitalization.py new file mode 100644 index 00000000000..9dc20aa55e4 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/capitalization.py @@ -0,0 +1,243 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Capitalization(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'small_camel': 'str', + 'capital_camel': 'str', + 'small_snake': 'str', + 'capital_snake': 'str', + 'sca_eth_flow_points': 'str', + 'att_name': 'str' + } + + attribute_map = { + 'small_camel': 'smallCamel', + 'capital_camel': 'CapitalCamel', + 'small_snake': 'small_Snake', + 'capital_snake': 'Capital_Snake', + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', + 'att_name': 'ATT_NAME' + } + + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + """Capitalization - a model defined in Swagger""" # noqa: E501 + self._small_camel = None + self._capital_camel = None + self._small_snake = None + self._capital_snake = None + self._sca_eth_flow_points = None + self._att_name = None + self.discriminator = None + if small_camel is not None: + self.small_camel = small_camel + if capital_camel is not None: + self.capital_camel = capital_camel + if small_snake is not None: + self.small_snake = small_snake + if capital_snake is not None: + self.capital_snake = capital_snake + if sca_eth_flow_points is not None: + self.sca_eth_flow_points = sca_eth_flow_points + if att_name is not None: + self.att_name = att_name + + @property + def small_camel(self): + """Gets the small_camel of this Capitalization. # noqa: E501 + + + :return: The small_camel of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._small_camel + + @small_camel.setter + def small_camel(self, small_camel): + """Sets the small_camel of this Capitalization. + + + :param small_camel: The small_camel of this Capitalization. # noqa: E501 + :type: str + """ + + self._small_camel = small_camel + + @property + def capital_camel(self): + """Gets the capital_camel of this Capitalization. # noqa: E501 + + + :return: The capital_camel of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._capital_camel + + @capital_camel.setter + def capital_camel(self, capital_camel): + """Sets the capital_camel of this Capitalization. + + + :param capital_camel: The capital_camel of this Capitalization. # noqa: E501 + :type: str + """ + + self._capital_camel = capital_camel + + @property + def small_snake(self): + """Gets the small_snake of this Capitalization. # noqa: E501 + + + :return: The small_snake of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._small_snake + + @small_snake.setter + def small_snake(self, small_snake): + """Sets the small_snake of this Capitalization. + + + :param small_snake: The small_snake of this Capitalization. # noqa: E501 + :type: str + """ + + self._small_snake = small_snake + + @property + def capital_snake(self): + """Gets the capital_snake of this Capitalization. # noqa: E501 + + + :return: The capital_snake of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._capital_snake + + @capital_snake.setter + def capital_snake(self, capital_snake): + """Sets the capital_snake of this Capitalization. + + + :param capital_snake: The capital_snake of this Capitalization. # noqa: E501 + :type: str + """ + + self._capital_snake = capital_snake + + @property + def sca_eth_flow_points(self): + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 + + + :return: The sca_eth_flow_points of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._sca_eth_flow_points + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, sca_eth_flow_points): + """Sets the sca_eth_flow_points of this Capitalization. + + + :param sca_eth_flow_points: The sca_eth_flow_points of this Capitalization. # noqa: E501 + :type: str + """ + + self._sca_eth_flow_points = sca_eth_flow_points + + @property + def att_name(self): + """Gets the att_name of this Capitalization. # noqa: E501 + + Name of the pet # noqa: E501 + + :return: The att_name of this Capitalization. # noqa: E501 + :rtype: str + """ + return self._att_name + + @att_name.setter + def att_name(self, att_name): + """Sets the att_name of this Capitalization. + + Name of the pet # noqa: E501 + + :param att_name: The att_name of this Capitalization. # noqa: E501 + :type: str + """ + + self._att_name = att_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Capitalization, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Capitalization): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/cat.py b/samples/client/petstore/python/swagger_client/models/cat.py new file mode 100644 index 00000000000..fa3726652ec --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/cat.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Cat(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str', + 'declawed': 'bool' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color', + 'declawed': 'declawed' + } + + def __init__(self, class_name=None, color='red', declawed=None): # noqa: E501 + """Cat - a model defined in Swagger""" # noqa: E501 + self._class_name = None + self._color = None + self._declawed = None + self.discriminator = None + self.class_name = class_name + if color is not None: + self.color = color + if declawed is not None: + self.declawed = declawed + + @property + def class_name(self): + """Gets the class_name of this Cat. # noqa: E501 + + + :return: The class_name of this Cat. # noqa: E501 + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """Sets the class_name of this Cat. + + + :param class_name: The class_name of this Cat. # noqa: E501 + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 + + self._class_name = class_name + + @property + def color(self): + """Gets the color of this Cat. # noqa: E501 + + + :return: The color of this Cat. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this Cat. + + + :param color: The color of this Cat. # noqa: E501 + :type: str + """ + + self._color = color + + @property + def declawed(self): + """Gets the declawed of this Cat. # noqa: E501 + + + :return: The declawed of this Cat. # noqa: E501 + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """Sets the declawed of this Cat. + + + :param declawed: The declawed of this Cat. # noqa: E501 + :type: bool + """ + + self._declawed = declawed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Cat, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Cat): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/category.py b/samples/client/petstore/python/swagger_client/models/category.py new file mode 100644 index 00000000000..7ccb7b7e59c --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/category.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Category(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Category - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Category. # noqa: E501 + + + :return: The id of this Category. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Category. + + + :param id: The id of this Category. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Category. # noqa: E501 + + + :return: The name of this Category. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Category. + + + :param name: The name of this Category. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Category, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Category): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/class_model.py b/samples/client/petstore/python/swagger_client/models/class_model.py new file mode 100644 index 00000000000..44b69f1571f --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/class_model.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ClassModel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_class': 'str' + } + + attribute_map = { + '_class': '_class' + } + + def __init__(self, _class=None): # noqa: E501 + """ClassModel - a model defined in Swagger""" # noqa: E501 + self.__class = None + self.discriminator = None + if _class is not None: + self._class = _class + + @property + def _class(self): + """Gets the _class of this ClassModel. # noqa: E501 + + + :return: The _class of this ClassModel. # noqa: E501 + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """Sets the _class of this ClassModel. + + + :param _class: The _class of this ClassModel. # noqa: E501 + :type: str + """ + + self.__class = _class + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ClassModel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClassModel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/client.py b/samples/client/petstore/python/swagger_client/models/client.py new file mode 100644 index 00000000000..4080b1a734d --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/client.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Client(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'client': 'str' + } + + attribute_map = { + 'client': 'client' + } + + def __init__(self, client=None): # noqa: E501 + """Client - a model defined in Swagger""" # noqa: E501 + self._client = None + self.discriminator = None + if client is not None: + self.client = client + + @property + def client(self): + """Gets the client of this Client. # noqa: E501 + + + :return: The client of this Client. # noqa: E501 + :rtype: str + """ + return self._client + + @client.setter + def client(self, client): + """Sets the client of this Client. + + + :param client: The client of this Client. # noqa: E501 + :type: str + """ + + self._client = client + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Client, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Client): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/dog.py b/samples/client/petstore/python/swagger_client/models/dog.py new file mode 100644 index 00000000000..a06ae0c9cae --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/dog.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Dog(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'class_name': 'str', + 'color': 'str', + 'breed': 'str' + } + + attribute_map = { + 'class_name': 'className', + 'color': 'color', + 'breed': 'breed' + } + + def __init__(self, class_name=None, color='red', breed=None): # noqa: E501 + """Dog - a model defined in Swagger""" # noqa: E501 + self._class_name = None + self._color = None + self._breed = None + self.discriminator = None + self.class_name = class_name + if color is not None: + self.color = color + if breed is not None: + self.breed = breed + + @property + def class_name(self): + """Gets the class_name of this Dog. # noqa: E501 + + + :return: The class_name of this Dog. # noqa: E501 + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """Sets the class_name of this Dog. + + + :param class_name: The class_name of this Dog. # noqa: E501 + :type: str + """ + if class_name is None: + raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 + + self._class_name = class_name + + @property + def color(self): + """Gets the color of this Dog. # noqa: E501 + + + :return: The color of this Dog. # noqa: E501 + :rtype: str + """ + return self._color + + @color.setter + def color(self, color): + """Sets the color of this Dog. + + + :param color: The color of this Dog. # noqa: E501 + :type: str + """ + + self._color = color + + @property + def breed(self): + """Gets the breed of this Dog. # noqa: E501 + + + :return: The breed of this Dog. # noqa: E501 + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """Sets the breed of this Dog. + + + :param breed: The breed of this Dog. # noqa: E501 + :type: str + """ + + self._breed = breed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Dog, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Dog): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/enum_arrays.py b/samples/client/petstore/python/swagger_client/models/enum_arrays.py new file mode 100644 index 00000000000..b15551e14a6 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/enum_arrays.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class EnumArrays(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_symbol': 'str', + 'array_enum': 'list[str]' + } + + attribute_map = { + 'just_symbol': 'just_symbol', + 'array_enum': 'array_enum' + } + + def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + """EnumArrays - a model defined in Swagger""" # noqa: E501 + self._just_symbol = None + self._array_enum = None + self.discriminator = None + if just_symbol is not None: + self.just_symbol = just_symbol + if array_enum is not None: + self.array_enum = array_enum + + @property + def just_symbol(self): + """Gets the just_symbol of this EnumArrays. # noqa: E501 + + + :return: The just_symbol of this EnumArrays. # noqa: E501 + :rtype: str + """ + return self._just_symbol + + @just_symbol.setter + def just_symbol(self, just_symbol): + """Sets the just_symbol of this EnumArrays. + + + :param just_symbol: The just_symbol of this EnumArrays. # noqa: E501 + :type: str + """ + allowed_values = [">=", "$"] # noqa: E501 + if just_symbol not in allowed_values: + raise ValueError( + "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 + .format(just_symbol, allowed_values) + ) + + self._just_symbol = just_symbol + + @property + def array_enum(self): + """Gets the array_enum of this EnumArrays. # noqa: E501 + + + :return: The array_enum of this EnumArrays. # noqa: E501 + :rtype: list[str] + """ + return self._array_enum + + @array_enum.setter + def array_enum(self, array_enum): + """Sets the array_enum of this EnumArrays. + + + :param array_enum: The array_enum of this EnumArrays. # noqa: E501 + :type: list[str] + """ + allowed_values = ["fish", "crab"] # noqa: E501 + if not set(array_enum).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._array_enum = array_enum + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumArrays, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumArrays): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/enum_class.py b/samples/client/petstore/python/swagger_client/models/enum_class.py new file mode 100644 index 00000000000..8158d048743 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/enum_class.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class EnumClass(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _ABC = "_abc" + _EFG = "-efg" + _XYZ_ = "(xyz)" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """EnumClass - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumClass, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/enum_test.py b/samples/client/petstore/python/swagger_client/models/enum_test.py new file mode 100644 index 00000000000..50eace382e9 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/enum_test.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class EnumTest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'enum_string': 'str', + 'enum_integer': 'int', + 'enum_number': 'float', + 'outer_enum': 'OuterEnum' + } + + attribute_map = { + 'enum_string': 'enum_string', + 'enum_integer': 'enum_integer', + 'enum_number': 'enum_number', + 'outer_enum': 'outerEnum' + } + + def __init__(self, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + """EnumTest - a model defined in Swagger""" # noqa: E501 + self._enum_string = None + self._enum_integer = None + self._enum_number = None + self._outer_enum = None + self.discriminator = None + if enum_string is not None: + self.enum_string = enum_string + if enum_integer is not None: + self.enum_integer = enum_integer + if enum_number is not None: + self.enum_number = enum_number + if outer_enum is not None: + self.outer_enum = outer_enum + + @property + def enum_string(self): + """Gets the enum_string of this EnumTest. # noqa: E501 + + + :return: The enum_string of this EnumTest. # noqa: E501 + :rtype: str + """ + return self._enum_string + + @enum_string.setter + def enum_string(self, enum_string): + """Sets the enum_string of this EnumTest. + + + :param enum_string: The enum_string of this EnumTest. # noqa: E501 + :type: str + """ + allowed_values = ["UPPER", "lower", ""] # noqa: E501 + if enum_string not in allowed_values: + raise ValueError( + "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 + .format(enum_string, allowed_values) + ) + + self._enum_string = enum_string + + @property + def enum_integer(self): + """Gets the enum_integer of this EnumTest. # noqa: E501 + + + :return: The enum_integer of this EnumTest. # noqa: E501 + :rtype: int + """ + return self._enum_integer + + @enum_integer.setter + def enum_integer(self, enum_integer): + """Sets the enum_integer of this EnumTest. + + + :param enum_integer: The enum_integer of this EnumTest. # noqa: E501 + :type: int + """ + allowed_values = [1, -1] # noqa: E501 + if enum_integer not in allowed_values: + raise ValueError( + "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 + .format(enum_integer, allowed_values) + ) + + self._enum_integer = enum_integer + + @property + def enum_number(self): + """Gets the enum_number of this EnumTest. # noqa: E501 + + + :return: The enum_number of this EnumTest. # noqa: E501 + :rtype: float + """ + return self._enum_number + + @enum_number.setter + def enum_number(self, enum_number): + """Sets the enum_number of this EnumTest. + + + :param enum_number: The enum_number of this EnumTest. # noqa: E501 + :type: float + """ + allowed_values = [1.1, -1.2] # noqa: E501 + if enum_number not in allowed_values: + raise ValueError( + "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 + .format(enum_number, allowed_values) + ) + + self._enum_number = enum_number + + @property + def outer_enum(self): + """Gets the outer_enum of this EnumTest. # noqa: E501 + + + :return: The outer_enum of this EnumTest. # noqa: E501 + :rtype: OuterEnum + """ + return self._outer_enum + + @outer_enum.setter + def outer_enum(self, outer_enum): + """Sets the outer_enum of this EnumTest. + + + :param outer_enum: The outer_enum of this EnumTest. # noqa: E501 + :type: OuterEnum + """ + + self._outer_enum = outer_enum + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnumTest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/format_test.py b/samples/client/petstore/python/swagger_client/models/format_test.py new file mode 100644 index 00000000000..7136ffcf6bd --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/format_test.py @@ -0,0 +1,427 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class FormatTest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'integer': 'int', + 'int32': 'int', + 'int64': 'int', + 'number': 'float', + '_float': 'float', + 'double': 'float', + 'string': 'str', + 'byte': 'str', + 'binary': 'str', + '_date': 'date', + 'date_time': 'datetime', + 'uuid': 'str', + 'password': 'str' + } + + attribute_map = { + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'number': 'number', + '_float': 'float', + 'double': 'double', + 'string': 'string', + 'byte': 'byte', + 'binary': 'binary', + '_date': 'date', + 'date_time': 'dateTime', + 'uuid': 'uuid', + 'password': 'password' + } + + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None): # noqa: E501 + """FormatTest - a model defined in Swagger""" # noqa: E501 + self._integer = None + self._int32 = None + self._int64 = None + self._number = None + self.__float = None + self._double = None + self._string = None + self._byte = None + self._binary = None + self.__date = None + self._date_time = None + self._uuid = None + self._password = None + self.discriminator = None + if integer is not None: + self.integer = integer + if int32 is not None: + self.int32 = int32 + if int64 is not None: + self.int64 = int64 + self.number = number + if _float is not None: + self._float = _float + if double is not None: + self.double = double + if string is not None: + self.string = string + self.byte = byte + if binary is not None: + self.binary = binary + self._date = _date + if date_time is not None: + self.date_time = date_time + if uuid is not None: + self.uuid = uuid + self.password = password + + @property + def integer(self): + """Gets the integer of this FormatTest. # noqa: E501 + + + :return: The integer of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._integer + + @integer.setter + def integer(self, integer): + """Sets the integer of this FormatTest. + + + :param integer: The integer of this FormatTest. # noqa: E501 + :type: int + """ + + self._integer = integer + + @property + def int32(self): + """Gets the int32 of this FormatTest. # noqa: E501 + + + :return: The int32 of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._int32 + + @int32.setter + def int32(self, int32): + """Sets the int32 of this FormatTest. + + + :param int32: The int32 of this FormatTest. # noqa: E501 + :type: int + """ + + self._int32 = int32 + + @property + def int64(self): + """Gets the int64 of this FormatTest. # noqa: E501 + + + :return: The int64 of this FormatTest. # noqa: E501 + :rtype: int + """ + return self._int64 + + @int64.setter + def int64(self, int64): + """Sets the int64 of this FormatTest. + + + :param int64: The int64 of this FormatTest. # noqa: E501 + :type: int + """ + + self._int64 = int64 + + @property + def number(self): + """Gets the number of this FormatTest. # noqa: E501 + + + :return: The number of this FormatTest. # noqa: E501 + :rtype: float + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this FormatTest. + + + :param number: The number of this FormatTest. # noqa: E501 + :type: float + """ + if number is None: + raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 + + self._number = number + + @property + def _float(self): + """Gets the _float of this FormatTest. # noqa: E501 + + + :return: The _float of this FormatTest. # noqa: E501 + :rtype: float + """ + return self.__float + + @_float.setter + def _float(self, _float): + """Sets the _float of this FormatTest. + + + :param _float: The _float of this FormatTest. # noqa: E501 + :type: float + """ + + self.__float = _float + + @property + def double(self): + """Gets the double of this FormatTest. # noqa: E501 + + + :return: The double of this FormatTest. # noqa: E501 + :rtype: float + """ + return self._double + + @double.setter + def double(self, double): + """Sets the double of this FormatTest. + + + :param double: The double of this FormatTest. # noqa: E501 + :type: float + """ + + self._double = double + + @property + def string(self): + """Gets the string of this FormatTest. # noqa: E501 + + + :return: The string of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """Sets the string of this FormatTest. + + + :param string: The string of this FormatTest. # noqa: E501 + :type: str + """ + + self._string = string + + @property + def byte(self): + """Gets the byte of this FormatTest. # noqa: E501 + + + :return: The byte of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._byte + + @byte.setter + def byte(self, byte): + """Sets the byte of this FormatTest. + + + :param byte: The byte of this FormatTest. # noqa: E501 + :type: str + """ + if byte is None: + raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 + + self._byte = byte + + @property + def binary(self): + """Gets the binary of this FormatTest. # noqa: E501 + + + :return: The binary of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._binary + + @binary.setter + def binary(self, binary): + """Sets the binary of this FormatTest. + + + :param binary: The binary of this FormatTest. # noqa: E501 + :type: str + """ + + self._binary = binary + + @property + def _date(self): + """Gets the _date of this FormatTest. # noqa: E501 + + + :return: The _date of this FormatTest. # noqa: E501 + :rtype: date + """ + return self.__date + + @_date.setter + def _date(self, _date): + """Sets the _date of this FormatTest. + + + :param _date: The _date of this FormatTest. # noqa: E501 + :type: date + """ + if _date is None: + raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 + + self.__date = _date + + @property + def date_time(self): + """Gets the date_time of this FormatTest. # noqa: E501 + + + :return: The date_time of this FormatTest. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this FormatTest. + + + :param date_time: The date_time of this FormatTest. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def uuid(self): + """Gets the uuid of this FormatTest. # noqa: E501 + + + :return: The uuid of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this FormatTest. + + + :param uuid: The uuid of this FormatTest. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + @property + def password(self): + """Gets the password of this FormatTest. # noqa: E501 + + + :return: The password of this FormatTest. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this FormatTest. + + + :param password: The password of this FormatTest. # noqa: E501 + :type: str + """ + if password is None: + raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 + + self._password = password + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(FormatTest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FormatTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/has_only_read_only.py b/samples/client/petstore/python/swagger_client/models/has_only_read_only.py new file mode 100644 index 00000000000..2a6df64a6cd --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/has_only_read_only.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class HasOnlyReadOnly(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'foo': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'foo': 'foo' + } + + def __init__(self, bar=None, foo=None): # noqa: E501 + """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501 + self._bar = None + self._foo = None + self.discriminator = None + if bar is not None: + self.bar = bar + if foo is not None: + self.foo = foo + + @property + def bar(self): + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 + + + :return: The bar of this HasOnlyReadOnly. # noqa: E501 + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """Sets the bar of this HasOnlyReadOnly. + + + :param bar: The bar of this HasOnlyReadOnly. # noqa: E501 + :type: str + """ + + self._bar = bar + + @property + def foo(self): + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 + + + :return: The foo of this HasOnlyReadOnly. # noqa: E501 + :rtype: str + """ + return self._foo + + @foo.setter + def foo(self, foo): + """Sets the foo of this HasOnlyReadOnly. + + + :param foo: The foo of this HasOnlyReadOnly. # noqa: E501 + :type: str + """ + + self._foo = foo + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(HasOnlyReadOnly, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HasOnlyReadOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/list.py b/samples/client/petstore/python/swagger_client/models/list.py new file mode 100644 index 00000000000..5d51b6543d5 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/list.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class List(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_123_list': 'str' + } + + attribute_map = { + '_123_list': '123-list' + } + + def __init__(self, _123_list=None): # noqa: E501 + """List - a model defined in Swagger""" # noqa: E501 + self.__123_list = None + self.discriminator = None + if _123_list is not None: + self._123_list = _123_list + + @property + def _123_list(self): + """Gets the _123_list of this List. # noqa: E501 + + + :return: The _123_list of this List. # noqa: E501 + :rtype: str + """ + return self.__123_list + + @_123_list.setter + def _123_list(self, _123_list): + """Sets the _123_list of this List. + + + :param _123_list: The _123_list of this List. # noqa: E501 + :type: str + """ + + self.__123_list = _123_list + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(List, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, List): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/map_test.py b/samples/client/petstore/python/swagger_client/models/map_test.py new file mode 100644 index 00000000000..c0184550da4 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/map_test.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class MapTest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'map_map_of_string': 'dict(str, dict(str, str))', + 'map_of_enum_string': 'dict(str, str)' + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', + 'map_of_enum_string': 'map_of_enum_string' + } + + def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501 + """MapTest - a model defined in Swagger""" # noqa: E501 + self._map_map_of_string = None + self._map_of_enum_string = None + self.discriminator = None + if map_map_of_string is not None: + self.map_map_of_string = map_map_of_string + if map_of_enum_string is not None: + self.map_of_enum_string = map_of_enum_string + + @property + def map_map_of_string(self): + """Gets the map_map_of_string of this MapTest. # noqa: E501 + + + :return: The map_map_of_string of this MapTest. # noqa: E501 + :rtype: dict(str, dict(str, str)) + """ + return self._map_map_of_string + + @map_map_of_string.setter + def map_map_of_string(self, map_map_of_string): + """Sets the map_map_of_string of this MapTest. + + + :param map_map_of_string: The map_map_of_string of this MapTest. # noqa: E501 + :type: dict(str, dict(str, str)) + """ + + self._map_map_of_string = map_map_of_string + + @property + def map_of_enum_string(self): + """Gets the map_of_enum_string of this MapTest. # noqa: E501 + + + :return: The map_of_enum_string of this MapTest. # noqa: E501 + :rtype: dict(str, str) + """ + return self._map_of_enum_string + + @map_of_enum_string.setter + def map_of_enum_string(self, map_of_enum_string): + """Sets the map_of_enum_string of this MapTest. + + + :param map_of_enum_string: The map_of_enum_string of this MapTest. # noqa: E501 + :type: dict(str, str) + """ + allowed_values = ["UPPER", "lower"] # noqa: E501 + if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._map_of_enum_string = map_of_enum_string + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MapTest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MapTest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..e563a533206 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class MixedPropertiesAndAdditionalPropertiesClass(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uuid': 'str', + 'date_time': 'datetime', + 'map': 'dict(str, Animal)' + } + + attribute_map = { + 'uuid': 'uuid', + 'date_time': 'dateTime', + 'map': 'map' + } + + def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 + self._uuid = None + self._date_time = None + self._map = None + self.discriminator = None + if uuid is not None: + self.uuid = uuid + if date_time is not None: + self.date_time = date_time + if map is not None: + self.map = map + + @property + def uuid(self): + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid): + """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param uuid: The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: str + """ + + self._uuid = uuid + + @property + def date_time(self): + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: datetime + """ + return self._date_time + + @date_time.setter + def date_time(self, date_time): + """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param date_time: The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: datetime + """ + + self._date_time = date_time + + @property + def map(self): + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + + :return: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :rtype: dict(str, Animal) + """ + return self._map + + @map.setter + def map(self, map): + """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. + + + :param map: The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + :type: dict(str, Animal) + """ + + self._map = map + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MixedPropertiesAndAdditionalPropertiesClass, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/model200_response.py b/samples/client/petstore/python/swagger_client/models/model200_response.py new file mode 100644 index 00000000000..1be5722928b --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/model200_response.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Model200Response(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + '_class': 'str' + } + + attribute_map = { + 'name': 'name', + '_class': 'class' + } + + def __init__(self, name=None, _class=None): # noqa: E501 + """Model200Response - a model defined in Swagger""" # noqa: E501 + self._name = None + self.__class = None + self.discriminator = None + if name is not None: + self.name = name + if _class is not None: + self._class = _class + + @property + def name(self): + """Gets the name of this Model200Response. # noqa: E501 + + + :return: The name of this Model200Response. # noqa: E501 + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Model200Response. + + + :param name: The name of this Model200Response. # noqa: E501 + :type: int + """ + + self._name = name + + @property + def _class(self): + """Gets the _class of this Model200Response. # noqa: E501 + + + :return: The _class of this Model200Response. # noqa: E501 + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """Sets the _class of this Model200Response. + + + :param _class: The _class of this Model200Response. # noqa: E501 + :type: str + """ + + self.__class = _class + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Model200Response, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Model200Response): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/model_return.py b/samples/client/petstore/python/swagger_client/models/model_return.py new file mode 100644 index 00000000000..12fa1321579 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/model_return.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ModelReturn(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_return': 'int' + } + + attribute_map = { + '_return': 'return' + } + + def __init__(self, _return=None): # noqa: E501 + """ModelReturn - a model defined in Swagger""" # noqa: E501 + self.__return = None + self.discriminator = None + if _return is not None: + self._return = _return + + @property + def _return(self): + """Gets the _return of this ModelReturn. # noqa: E501 + + + :return: The _return of this ModelReturn. # noqa: E501 + :rtype: int + """ + return self.__return + + @_return.setter + def _return(self, _return): + """Sets the _return of this ModelReturn. + + + :param _return: The _return of this ModelReturn. # noqa: E501 + :type: int + """ + + self.__return = _return + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ModelReturn, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModelReturn): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/name.py b/samples/client/petstore/python/swagger_client/models/name.py new file mode 100644 index 00000000000..ca914f776e4 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/name.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Name(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'int', + 'snake_case': 'int', + '_property': 'str', + '_123_number': 'int' + } + + attribute_map = { + 'name': 'name', + 'snake_case': 'snake_case', + '_property': 'property', + '_123_number': '123Number' + } + + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in Swagger""" # noqa: E501 + self._name = None + self._snake_case = None + self.__property = None + self.__123_number = None + self.discriminator = None + self.name = name + if snake_case is not None: + self.snake_case = snake_case + if _property is not None: + self._property = _property + if _123_number is not None: + self._123_number = _123_number + + @property + def name(self): + """Gets the name of this Name. # noqa: E501 + + + :return: The name of this Name. # noqa: E501 + :rtype: int + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Name. + + + :param name: The name of this Name. # noqa: E501 + :type: int + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def snake_case(self): + """Gets the snake_case of this Name. # noqa: E501 + + + :return: The snake_case of this Name. # noqa: E501 + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """Sets the snake_case of this Name. + + + :param snake_case: The snake_case of this Name. # noqa: E501 + :type: int + """ + + self._snake_case = snake_case + + @property + def _property(self): + """Gets the _property of this Name. # noqa: E501 + + + :return: The _property of this Name. # noqa: E501 + :rtype: str + """ + return self.__property + + @_property.setter + def _property(self, _property): + """Sets the _property of this Name. + + + :param _property: The _property of this Name. # noqa: E501 + :type: str + """ + + self.__property = _property + + @property + def _123_number(self): + """Gets the _123_number of this Name. # noqa: E501 + + + :return: The _123_number of this Name. # noqa: E501 + :rtype: int + """ + return self.__123_number + + @_123_number.setter + def _123_number(self, _123_number): + """Sets the _123_number of this Name. + + + :param _123_number: The _123_number of this Name. # noqa: E501 + :type: int + """ + + self.__123_number = _123_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Name, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Name): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/number_only.py b/samples/client/petstore/python/swagger_client/models/number_only.py new file mode 100644 index 00000000000..c40f80b3b30 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/number_only.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class NumberOnly(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'just_number': 'float' + } + + attribute_map = { + 'just_number': 'JustNumber' + } + + def __init__(self, just_number=None): # noqa: E501 + """NumberOnly - a model defined in Swagger""" # noqa: E501 + self._just_number = None + self.discriminator = None + if just_number is not None: + self.just_number = just_number + + @property + def just_number(self): + """Gets the just_number of this NumberOnly. # noqa: E501 + + + :return: The just_number of this NumberOnly. # noqa: E501 + :rtype: float + """ + return self._just_number + + @just_number.setter + def just_number(self, just_number): + """Sets the just_number of this NumberOnly. + + + :param just_number: The just_number of this NumberOnly. # noqa: E501 + :type: float + """ + + self._just_number = just_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NumberOnly, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NumberOnly): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/one_of_all_pets_response_items.py b/samples/client/petstore/python/swagger_client/models/one_of_all_pets_response_items.py new file mode 100644 index 00000000000..fb0127fef5b --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/one_of_all_pets_response_items.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OneOfAllPetsResponseItems(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OneOfAllPetsResponseItems - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneOfAllPetsResponseItems, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneOfAllPetsResponseItems): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/one_of_single_pet_response_pet.py b/samples/client/petstore/python/swagger_client/models/one_of_single_pet_response_pet.py new file mode 100644 index 00000000000..ee862bd2d84 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/one_of_single_pet_response_pet.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OneOfSinglePetResponsePet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OneOfSinglePetResponsePet - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OneOfSinglePetResponsePet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OneOfSinglePetResponsePet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/order.py b/samples/client/petstore/python/swagger_client/models/order.py new file mode 100644 index 00000000000..da3e6f40f3c --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/order.py @@ -0,0 +1,249 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Order(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'pet_id': 'int', + 'quantity': 'int', + 'ship_date': 'datetime', + 'status': 'str', + 'complete': 'bool' + } + + attribute_map = { + 'id': 'id', + 'pet_id': 'petId', + 'quantity': 'quantity', + 'ship_date': 'shipDate', + 'status': 'status', + 'complete': 'complete' + } + + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + """Order - a model defined in Swagger""" # noqa: E501 + self._id = None + self._pet_id = None + self._quantity = None + self._ship_date = None + self._status = None + self._complete = None + self.discriminator = None + if id is not None: + self.id = id + if pet_id is not None: + self.pet_id = pet_id + if quantity is not None: + self.quantity = quantity + if ship_date is not None: + self.ship_date = ship_date + if status is not None: + self.status = status + if complete is not None: + self.complete = complete + + @property + def id(self): + """Gets the id of this Order. # noqa: E501 + + + :return: The id of this Order. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Order. + + + :param id: The id of this Order. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def pet_id(self): + """Gets the pet_id of this Order. # noqa: E501 + + + :return: The pet_id of this Order. # noqa: E501 + :rtype: int + """ + return self._pet_id + + @pet_id.setter + def pet_id(self, pet_id): + """Sets the pet_id of this Order. + + + :param pet_id: The pet_id of this Order. # noqa: E501 + :type: int + """ + + self._pet_id = pet_id + + @property + def quantity(self): + """Gets the quantity of this Order. # noqa: E501 + + + :return: The quantity of this Order. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this Order. + + + :param quantity: The quantity of this Order. # noqa: E501 + :type: int + """ + + self._quantity = quantity + + @property + def ship_date(self): + """Gets the ship_date of this Order. # noqa: E501 + + + :return: The ship_date of this Order. # noqa: E501 + :rtype: datetime + """ + return self._ship_date + + @ship_date.setter + def ship_date(self, ship_date): + """Sets the ship_date of this Order. + + + :param ship_date: The ship_date of this Order. # noqa: E501 + :type: datetime + """ + + self._ship_date = ship_date + + @property + def status(self): + """Gets the status of this Order. # noqa: E501 + + Order Status # noqa: E501 + + :return: The status of this Order. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Order. + + Order Status # noqa: E501 + + :param status: The status of this Order. # noqa: E501 + :type: str + """ + allowed_values = ["placed", "approved", "delivered"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def complete(self): + """Gets the complete of this Order. # noqa: E501 + + + :return: The complete of this Order. # noqa: E501 + :rtype: bool + """ + return self._complete + + @complete.setter + def complete(self, complete): + """Sets the complete of this Order. + + + :param complete: The complete of this Order. # noqa: E501 + :type: bool + """ + + self._complete = complete + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Order, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Order): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/outer_boolean.py b/samples/client/petstore/python/swagger_client/models/outer_boolean.py new file mode 100644 index 00000000000..064510cedf6 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/outer_boolean.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OuterBoolean(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OuterBoolean - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OuterBoolean, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterBoolean): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/outer_composite.py b/samples/client/petstore/python/swagger_client/models/outer_composite.py new file mode 100644 index 00000000000..acabbf98bfb --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/outer_composite.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OuterComposite(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'my_number': 'OuterNumber', + 'my_string': 'OuterString', + 'my_boolean': 'OuterBoolean' + } + + attribute_map = { + 'my_number': 'my_number', + 'my_string': 'my_string', + 'my_boolean': 'my_boolean' + } + + def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + """OuterComposite - a model defined in Swagger""" # noqa: E501 + self._my_number = None + self._my_string = None + self._my_boolean = None + self.discriminator = None + if my_number is not None: + self.my_number = my_number + if my_string is not None: + self.my_string = my_string + if my_boolean is not None: + self.my_boolean = my_boolean + + @property + def my_number(self): + """Gets the my_number of this OuterComposite. # noqa: E501 + + + :return: The my_number of this OuterComposite. # noqa: E501 + :rtype: OuterNumber + """ + return self._my_number + + @my_number.setter + def my_number(self, my_number): + """Sets the my_number of this OuterComposite. + + + :param my_number: The my_number of this OuterComposite. # noqa: E501 + :type: OuterNumber + """ + + self._my_number = my_number + + @property + def my_string(self): + """Gets the my_string of this OuterComposite. # noqa: E501 + + + :return: The my_string of this OuterComposite. # noqa: E501 + :rtype: OuterString + """ + return self._my_string + + @my_string.setter + def my_string(self, my_string): + """Sets the my_string of this OuterComposite. + + + :param my_string: The my_string of this OuterComposite. # noqa: E501 + :type: OuterString + """ + + self._my_string = my_string + + @property + def my_boolean(self): + """Gets the my_boolean of this OuterComposite. # noqa: E501 + + + :return: The my_boolean of this OuterComposite. # noqa: E501 + :rtype: OuterBoolean + """ + return self._my_boolean + + @my_boolean.setter + def my_boolean(self, my_boolean): + """Sets the my_boolean of this OuterComposite. + + + :param my_boolean: The my_boolean of this OuterComposite. # noqa: E501 + :type: OuterBoolean + """ + + self._my_boolean = my_boolean + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OuterComposite, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterComposite): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/outer_enum.py b/samples/client/petstore/python/swagger_client/models/outer_enum.py new file mode 100644 index 00000000000..879e3a8d322 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/outer_enum.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OuterEnum(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PLACED = "placed" + APPROVED = "approved" + DELIVERED = "delivered" + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OuterEnum - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OuterEnum, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/outer_number.py b/samples/client/petstore/python/swagger_client/models/outer_number.py new file mode 100644 index 00000000000..6dd01c5dd15 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/outer_number.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OuterNumber(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OuterNumber - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OuterNumber, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/outer_string.py b/samples/client/petstore/python/swagger_client/models/outer_string.py new file mode 100644 index 00000000000..a71ec28e86d --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/outer_string.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class OuterString(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """OuterString - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OuterString, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterString): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/pet.py b/samples/client/petstore/python/swagger_client/models/pet.py new file mode 100644 index 00000000000..31d90fea204 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/pet.py @@ -0,0 +1,251 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Pet(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'category': 'Category', + 'name': 'str', + 'photo_urls': 'list[str]', + 'tags': 'list[Tag]', + 'status': 'str' + } + + attribute_map = { + 'id': 'id', + 'category': 'category', + 'name': 'name', + 'photo_urls': 'photoUrls', + 'tags': 'tags', + 'status': 'status' + } + + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + """Pet - a model defined in Swagger""" # noqa: E501 + self._id = None + self._category = None + self._name = None + self._photo_urls = None + self._tags = None + self._status = None + self.discriminator = None + if id is not None: + self.id = id + if category is not None: + self.category = category + self.name = name + self.photo_urls = photo_urls + if tags is not None: + self.tags = tags + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this Pet. # noqa: E501 + + + :return: The id of this Pet. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Pet. + + + :param id: The id of this Pet. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def category(self): + """Gets the category of this Pet. # noqa: E501 + + + :return: The category of this Pet. # noqa: E501 + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Pet. + + + :param category: The category of this Pet. # noqa: E501 + :type: Category + """ + + self._category = category + + @property + def name(self): + """Gets the name of this Pet. # noqa: E501 + + + :return: The name of this Pet. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Pet. + + + :param name: The name of this Pet. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def photo_urls(self): + """Gets the photo_urls of this Pet. # noqa: E501 + + + :return: The photo_urls of this Pet. # noqa: E501 + :rtype: list[str] + """ + return self._photo_urls + + @photo_urls.setter + def photo_urls(self, photo_urls): + """Sets the photo_urls of this Pet. + + + :param photo_urls: The photo_urls of this Pet. # noqa: E501 + :type: list[str] + """ + if photo_urls is None: + raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 + + self._photo_urls = photo_urls + + @property + def tags(self): + """Gets the tags of this Pet. # noqa: E501 + + + :return: The tags of this Pet. # noqa: E501 + :rtype: list[Tag] + """ + return self._tags + + @tags.setter + def tags(self, tags): + """Sets the tags of this Pet. + + + :param tags: The tags of this Pet. # noqa: E501 + :type: list[Tag] + """ + + self._tags = tags + + @property + def status(self): + """Gets the status of this Pet. # noqa: E501 + + pet status in the store # noqa: E501 + + :return: The status of this Pet. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Pet. + + pet status in the store # noqa: E501 + + :param status: The status of this Pet. # noqa: E501 + :type: str + """ + allowed_values = ["available", "pending", "sold"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Pet, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Pet): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/read_only_first.py b/samples/client/petstore/python/swagger_client/models/read_only_first.py new file mode 100644 index 00000000000..bfdff46aae8 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/read_only_first.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class ReadOnlyFirst(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bar': 'str', + 'baz': 'str' + } + + attribute_map = { + 'bar': 'bar', + 'baz': 'baz' + } + + def __init__(self, bar=None, baz=None): # noqa: E501 + """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501 + self._bar = None + self._baz = None + self.discriminator = None + if bar is not None: + self.bar = bar + if baz is not None: + self.baz = baz + + @property + def bar(self): + """Gets the bar of this ReadOnlyFirst. # noqa: E501 + + + :return: The bar of this ReadOnlyFirst. # noqa: E501 + :rtype: str + """ + return self._bar + + @bar.setter + def bar(self, bar): + """Sets the bar of this ReadOnlyFirst. + + + :param bar: The bar of this ReadOnlyFirst. # noqa: E501 + :type: str + """ + + self._bar = bar + + @property + def baz(self): + """Gets the baz of this ReadOnlyFirst. # noqa: E501 + + + :return: The baz of this ReadOnlyFirst. # noqa: E501 + :rtype: str + """ + return self._baz + + @baz.setter + def baz(self, baz): + """Sets the baz of this ReadOnlyFirst. + + + :param baz: The baz of this ReadOnlyFirst. # noqa: E501 + :type: str + """ + + self._baz = baz + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ReadOnlyFirst, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReadOnlyFirst): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/single_pet_response.py b/samples/client/petstore/python/swagger_client/models/single_pet_response.py new file mode 100644 index 00000000000..f34d71aa811 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/single_pet_response.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SinglePetResponse(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'pet': 'OneOfSinglePetResponsePet' + } + + attribute_map = { + 'pet': 'pet' + } + + def __init__(self, pet=None): # noqa: E501 + """SinglePetResponse - a model defined in Swagger""" # noqa: E501 + self._pet = None + self.discriminator = None + if pet is not None: + self.pet = pet + + @property + def pet(self): + """Gets the pet of this SinglePetResponse. # noqa: E501 + + + :return: The pet of this SinglePetResponse. # noqa: E501 + :rtype: OneOfSinglePetResponsePet + """ + return self._pet + + @pet.setter + def pet(self, pet): + """Sets the pet of this SinglePetResponse. + + + :param pet: The pet of this SinglePetResponse. # noqa: E501 + :type: OneOfSinglePetResponsePet + """ + + self._pet = pet + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SinglePetResponse, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SinglePetResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/special_model_name.py b/samples/client/petstore/python/swagger_client/models/special_model_name.py new file mode 100644 index 00000000000..d495ffcf4e1 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/special_model_name.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class SpecialModelName(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'special_property_name': 'int' + } + + attribute_map = { + 'special_property_name': '$special[property.name]' + } + + def __init__(self, special_property_name=None): # noqa: E501 + """SpecialModelName - a model defined in Swagger""" # noqa: E501 + self._special_property_name = None + self.discriminator = None + if special_property_name is not None: + self.special_property_name = special_property_name + + @property + def special_property_name(self): + """Gets the special_property_name of this SpecialModelName. # noqa: E501 + + + :return: The special_property_name of this SpecialModelName. # noqa: E501 + :rtype: int + """ + return self._special_property_name + + @special_property_name.setter + def special_property_name(self, special_property_name): + """Sets the special_property_name of this SpecialModelName. + + + :param special_property_name: The special_property_name of this SpecialModelName. # noqa: E501 + :type: int + """ + + self._special_property_name = special_property_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SpecialModelName, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialModelName): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/tag.py b/samples/client/petstore/python/swagger_client/models/tag.py new file mode 100644 index 00000000000..3ccd79ee98e --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/tag.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class Tag(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Tag - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Tag. # noqa: E501 + + + :return: The id of this Tag. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Tag. + + + :param id: The id of this Tag. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Tag. # noqa: E501 + + + :return: The name of this Tag. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Tag. + + + :param name: The name of this Tag. # noqa: E501 + :type: str + """ + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Tag, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tag): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/models/user.py b/samples/client/petstore/python/swagger_client/models/user.py new file mode 100644 index 00000000000..d2bd07f2374 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/user.py @@ -0,0 +1,295 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + + +class User(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'username': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'email': 'str', + 'password': 'str', + 'phone': 'str', + 'user_status': 'int' + } + + attribute_map = { + 'id': 'id', + 'username': 'username', + 'first_name': 'firstName', + 'last_name': 'lastName', + 'email': 'email', + 'password': 'password', + 'phone': 'phone', + 'user_status': 'userStatus' + } + + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + """User - a model defined in Swagger""" # noqa: E501 + self._id = None + self._username = None + self._first_name = None + self._last_name = None + self._email = None + self._password = None + self._phone = None + self._user_status = None + self.discriminator = None + if id is not None: + self.id = id + if username is not None: + self.username = username + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if email is not None: + self.email = email + if password is not None: + self.password = password + if phone is not None: + self.phone = phone + if user_status is not None: + self.user_status = user_status + + @property + def id(self): + """Gets the id of this User. # noqa: E501 + + + :return: The id of this User. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this User. + + + :param id: The id of this User. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def username(self): + """Gets the username of this User. # noqa: E501 + + + :return: The username of this User. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this User. + + + :param username: The username of this User. # noqa: E501 + :type: str + """ + + self._username = username + + @property + def first_name(self): + """Gets the first_name of this User. # noqa: E501 + + + :return: The first_name of this User. # noqa: E501 + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """Sets the first_name of this User. + + + :param first_name: The first_name of this User. # noqa: E501 + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """Gets the last_name of this User. # noqa: E501 + + + :return: The last_name of this User. # noqa: E501 + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """Sets the last_name of this User. + + + :param last_name: The last_name of this User. # noqa: E501 + :type: str + """ + + self._last_name = last_name + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + + :return: The email of this User. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this User. + + + :param email: The email of this User. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def password(self): + """Gets the password of this User. # noqa: E501 + + + :return: The password of this User. # noqa: E501 + :rtype: str + """ + return self._password + + @password.setter + def password(self, password): + """Sets the password of this User. + + + :param password: The password of this User. # noqa: E501 + :type: str + """ + + self._password = password + + @property + def phone(self): + """Gets the phone of this User. # noqa: E501 + + + :return: The phone of this User. # noqa: E501 + :rtype: str + """ + return self._phone + + @phone.setter + def phone(self, phone): + """Sets the phone of this User. + + + :param phone: The phone of this User. # noqa: E501 + :type: str + """ + + self._phone = phone + + @property + def user_status(self): + """Gets the user_status of this User. # noqa: E501 + + User Status # noqa: E501 + + :return: The user_status of this User. # noqa: E501 + :rtype: int + """ + return self._user_status + + @user_status.setter + def user_status(self, user_status): + """Sets the user_status of this User. + + User Status # noqa: E501 + + :param user_status: The user_status of this User. # noqa: E501 + :type: int + """ + + self._user_status = user_status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/client/petstore/python/swagger_client/rest.py b/samples/client/petstore/python/swagger_client/rest.py new file mode 100644 index 00000000000..9c694eddd07 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/rest.py @@ -0,0 +1,322 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/samples/client/petstore/python/test-requirements.txt b/samples/client/petstore/python/test-requirements.txt new file mode 100644 index 00000000000..2702246c0e6 --- /dev/null +++ b/samples/client/petstore/python/test-requirements.txt @@ -0,0 +1,5 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/samples/client/petstore/python/test/__init__.py b/samples/client/petstore/python/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/client/petstore/python/test/test_additional_properties_class.py b/samples/client/petstore/python/test/test_additional_properties_class.py new file mode 100644 index 00000000000..f1a95191eff --- /dev/null +++ b/samples/client/petstore/python/test/test_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_all_pets_response.py b/samples/client/petstore/python/test/test_all_pets_response.py new file mode 100644 index 00000000000..d00b318408c --- /dev/null +++ b/samples/client/petstore/python/test/test_all_pets_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.all_pets_response import AllPetsResponse # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAllPetsResponse(unittest.TestCase): + """AllPetsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAllPetsResponse(self): + """Test AllPetsResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.all_pets_response.AllPetsResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py new file mode 100644 index 00000000000..a8abb331743 --- /dev/null +++ b/samples/client/petstore/python/test/test_animal.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.animal import Animal # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.animal.Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_animal_api.py b/samples/client/petstore/python/test/test_animal_api.py new file mode 100644 index 00000000000..9900b8f6dd3 --- /dev/null +++ b/samples/client/petstore/python/test/test_animal_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.animal_api import AnimalApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAnimalApi(unittest.TestCase): + """AnimalApi unit test stubs""" + + def setUp(self): + self.api = api.animal_api.AnimalApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_animal(self): + """Test case for add_animal + + Add a new animal to the store # noqa: E501 + """ + pass + + def test_delete_animal(self): + """Test case for delete_animal + + Deletes a animal # noqa: E501 + """ + pass + + def test_get_animal_by_id(self): + """Test case for get_animal_by_id + + Find animal by ID # noqa: E501 + """ + pass + + def test_update_animal(self): + """Test case for update_animal + + Update an existing animal # noqa: E501 + """ + pass + + def test_update_animal_with_form(self): + """Test case for update_animal_with_form + + Updates a animal # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_animal_farm.py b/samples/client/petstore/python/test/test_animal_farm.py new file mode 100644 index 00000000000..6fbb9ff6b64 --- /dev/null +++ b/samples/client/petstore/python/test/test_animal_farm.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.animal_farm import AnimalFarm # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAnimalFarm(unittest.TestCase): + """AnimalFarm unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimalFarm(self): + """Test AnimalFarm""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.animal_farm.AnimalFarm() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_another_fake_api.py b/samples/client/petstore/python/test/test_another_fake_api.py new file mode 100644 index 00000000000..a2190dd4a10 --- /dev/null +++ b/samples/client/petstore/python/test/test_another_fake_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.another_fake_api import AnotherFakeApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = api.another_fake_api.AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_test_special_tags(self): + """Test case for test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_api_response.py b/samples/client/petstore/python/test/test_api_response.py new file mode 100644 index 00000000000..2aa04d6b21a --- /dev/null +++ b/samples/client/petstore/python/test/test_api_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.api_response import ApiResponse # noqa: E501 +from swagger_client.rest import ApiException + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.api_response.ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..d5a8752e155 --- /dev/null +++ b/samples/client/petstore/python/test/test_array_of_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 +from swagger_client.rest import ApiException + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_array_of_number_only.py b/samples/client/petstore/python/test/test_array_of_number_only.py new file mode 100644 index 00000000000..93da38782c2 --- /dev/null +++ b/samples/client/petstore/python/test/test_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 +from swagger_client.rest import ApiException + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_array_test.py b/samples/client/petstore/python/test/test_array_test.py new file mode 100644 index 00000000000..ba97e4fa706 --- /dev/null +++ b/samples/client/petstore/python/test/test_array_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.array_test import ArrayTest # noqa: E501 +from swagger_client.rest import ApiException + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.array_test.ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body.py b/samples/client/petstore/python/test/test_body.py new file mode 100644 index 00000000000..f31b37124be --- /dev/null +++ b/samples/client/petstore/python/test/test_body.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body import Body # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody(unittest.TestCase): + """Body unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody(self): + """Test Body""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body.Body() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body1.py b/samples/client/petstore/python/test/test_body1.py new file mode 100644 index 00000000000..124f42efdb1 --- /dev/null +++ b/samples/client/petstore/python/test/test_body1.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body1 import Body1 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody1(unittest.TestCase): + """Body1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody1(self): + """Test Body1""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body1.Body1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body2.py b/samples/client/petstore/python/test/test_body2.py new file mode 100644 index 00000000000..53e78b8ad2a --- /dev/null +++ b/samples/client/petstore/python/test/test_body2.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body2 import Body2 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody2(unittest.TestCase): + """Body2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody2(self): + """Test Body2""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body2.Body2() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body3.py b/samples/client/petstore/python/test/test_body3.py new file mode 100644 index 00000000000..81a09c09433 --- /dev/null +++ b/samples/client/petstore/python/test/test_body3.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body3 import Body3 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody3(unittest.TestCase): + """Body3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody3(self): + """Test Body3""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body3.Body3() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body4.py b/samples/client/petstore/python/test/test_body4.py new file mode 100644 index 00000000000..24ea94b51cb --- /dev/null +++ b/samples/client/petstore/python/test/test_body4.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body4 import Body4 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody4(unittest.TestCase): + """Body4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody4(self): + """Test Body4""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body4.Body4() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body5.py b/samples/client/petstore/python/test/test_body5.py new file mode 100644 index 00000000000..62aa09b2796 --- /dev/null +++ b/samples/client/petstore/python/test/test_body5.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body5 import Body5 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody5(unittest.TestCase): + """Body5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody5(self): + """Test Body5""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body5.Body5() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body6.py b/samples/client/petstore/python/test/test_body6.py new file mode 100644 index 00000000000..1d818b3168f --- /dev/null +++ b/samples/client/petstore/python/test/test_body6.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body6 import Body6 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody6(unittest.TestCase): + """Body6 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody6(self): + """Test Body6""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body6.Body6() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_body7.py b/samples/client/petstore/python/test/test_body7.py new file mode 100644 index 00000000000..2994c535f31 --- /dev/null +++ b/samples/client/petstore/python/test/test_body7.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.body7 import Body7 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestBody7(unittest.TestCase): + """Body7 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBody7(self): + """Test Body7""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.body7.Body7() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_capitalization.py b/samples/client/petstore/python/test/test_capitalization.py new file mode 100644 index 00000000000..cffe5a0c834 --- /dev/null +++ b/samples/client/petstore/python/test/test_capitalization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.capitalization import Capitalization # noqa: E501 +from swagger_client.rest import ApiException + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.capitalization.Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py new file mode 100644 index 00000000000..3a0c22e89aa --- /dev/null +++ b/samples/client/petstore/python/test/test_cat.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.cat import Cat # noqa: E501 +from swagger_client.rest import ApiException + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.cat.Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py new file mode 100644 index 00000000000..82752f9d200 --- /dev/null +++ b/samples/client/petstore/python/test/test_category.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.category import Category # noqa: E501 +from swagger_client.rest import ApiException + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.category.Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_class_model.py b/samples/client/petstore/python/test/test_class_model.py new file mode 100644 index 00000000000..ecc58b4bf48 --- /dev/null +++ b/samples/client/petstore/python/test/test_class_model.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.class_model import ClassModel # noqa: E501 +from swagger_client.rest import ApiException + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.class_model.ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_client.py b/samples/client/petstore/python/test/test_client.py new file mode 100644 index 00000000000..3f57935bd58 --- /dev/null +++ b/samples/client/petstore/python/test/test_client.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.client import Client # noqa: E501 +from swagger_client.rest import ApiException + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.client.Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_dog.py b/samples/client/petstore/python/test/test_dog.py new file mode 100644 index 00000000000..d7aca703d72 --- /dev/null +++ b/samples/client/petstore/python/test/test_dog.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.dog import Dog # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.dog.Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_dog_api.py b/samples/client/petstore/python/test/test_dog_api.py new file mode 100644 index 00000000000..085d664aa87 --- /dev/null +++ b/samples/client/petstore/python/test/test_dog_api.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.dog_api import DogApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDogApi(unittest.TestCase): + """DogApi unit test stubs""" + + def setUp(self): + self.api = api.dog_api.DogApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_dog(self): + """Test case for add_dog + + Add a new dog to the store # noqa: E501 + """ + pass + + def test_delete_dog(self): + """Test case for delete_dog + + Deletes a dog # noqa: E501 + """ + pass + + def test_get_dog_by_id(self): + """Test case for get_dog_by_id + + Find dog by ID # noqa: E501 + """ + pass + + def test_update_dog(self): + """Test case for update_dog + + Update an existing dog # noqa: E501 + """ + pass + + def test_update_dog_with_form(self): + """Test case for update_dog_with_form + + Updates a dog # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_enum_arrays.py b/samples/client/petstore/python/test/test_enum_arrays.py new file mode 100644 index 00000000000..aa8174d1ff1 --- /dev/null +++ b/samples/client/petstore/python/test/test_enum_arrays.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.enum_arrays import EnumArrays # noqa: E501 +from swagger_client.rest import ApiException + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.enum_arrays.EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py new file mode 100644 index 00000000000..2ff347fe869 --- /dev/null +++ b/samples/client/petstore/python/test/test_enum_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.enum_class import EnumClass # noqa: E501 +from swagger_client.rest import ApiException + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.enum_class.EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_enum_test.py b/samples/client/petstore/python/test/test_enum_test.py new file mode 100644 index 00000000000..4eb481379dd --- /dev/null +++ b/samples/client/petstore/python/test/test_enum_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.enum_test import EnumTest # noqa: E501 +from swagger_client.rest import ApiException + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.enum_test.EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py new file mode 100644 index 00000000000..267d8920f66 --- /dev/null +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.fake_api import FakeApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = api.fake_api.FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_enum_request_body(self): + """Test case for test_enum_request_body + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py new file mode 100644 index 00000000000..d8b2f18e885 --- /dev/null +++ b/samples/client/petstore/python/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from swagger_client.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py new file mode 100644 index 00000000000..1bf12ce32a7 --- /dev/null +++ b/samples/client/petstore/python/test/test_format_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.format_test import FormatTest # noqa: E501 +from swagger_client.rest import ApiException + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.format_test.FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_has_only_read_only.py b/samples/client/petstore/python/test/test_has_only_read_only.py new file mode 100644 index 00000000000..16c3ba862bd --- /dev/null +++ b/samples/client/petstore/python/test/test_has_only_read_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.has_only_read_only import HasOnlyReadOnly # noqa: E501 +from swagger_client.rest import ApiException + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_list.py b/samples/client/petstore/python/test/test_list.py new file mode 100644 index 00000000000..46882b27f68 --- /dev/null +++ b/samples/client/petstore/python/test/test_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.list import List # noqa: E501 +from swagger_client.rest import ApiException + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.list.List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python/test/test_map_test.py new file mode 100644 index 00000000000..91333947801 --- /dev/null +++ b/samples/client/petstore/python/test/test_map_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.map_test import MapTest # noqa: E501 +from swagger_client.rest import ApiException + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.map_test.MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..40fe2ef7c7f --- /dev/null +++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 +from swagger_client.rest import ApiException + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_model200_response.py b/samples/client/petstore/python/test/test_model200_response.py new file mode 100644 index 00000000000..e4dc45d5ca6 --- /dev/null +++ b/samples/client/petstore/python/test/test_model200_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.model200_response import Model200Response # noqa: E501 +from swagger_client.rest import ApiException + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.model200_response.Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_model_return.py b/samples/client/petstore/python/test/test_model_return.py new file mode 100644 index 00000000000..cab7910357d --- /dev/null +++ b/samples/client/petstore/python/test/test_model_return.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.model_return import ModelReturn # noqa: E501 +from swagger_client.rest import ApiException + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.model_return.ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_name.py b/samples/client/petstore/python/test/test_name.py new file mode 100644 index 00000000000..e3bd3a1b011 --- /dev/null +++ b/samples/client/petstore/python/test/test_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.name import Name # noqa: E501 +from swagger_client.rest import ApiException + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.name.Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_number_only.py b/samples/client/petstore/python/test/test_number_only.py new file mode 100644 index 00000000000..b5c62a8a85d --- /dev/null +++ b/samples/client/petstore/python/test/test_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.number_only import NumberOnly # noqa: E501 +from swagger_client.rest import ApiException + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.number_only.NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_one_of_all_pets_response_items.py b/samples/client/petstore/python/test/test_one_of_all_pets_response_items.py new file mode 100644 index 00000000000..b271761deb8 --- /dev/null +++ b/samples/client/petstore/python/test/test_one_of_all_pets_response_items.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.one_of_all_pets_response_items import OneOfAllPetsResponseItems # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOneOfAllPetsResponseItems(unittest.TestCase): + """OneOfAllPetsResponseItems unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOneOfAllPetsResponseItems(self): + """Test OneOfAllPetsResponseItems""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.one_of_all_pets_response_items.OneOfAllPetsResponseItems() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_one_of_single_pet_response_pet.py b/samples/client/petstore/python/test/test_one_of_single_pet_response_pet.py new file mode 100644 index 00000000000..e201718f4c2 --- /dev/null +++ b/samples/client/petstore/python/test/test_one_of_single_pet_response_pet.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.one_of_single_pet_response_pet import OneOfSinglePetResponsePet # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOneOfSinglePetResponsePet(unittest.TestCase): + """OneOfSinglePetResponsePet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOneOfSinglePetResponsePet(self): + """Test OneOfSinglePetResponsePet""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.one_of_single_pet_response_pet.OneOfSinglePetResponsePet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_order.py b/samples/client/petstore/python/test/test_order.py new file mode 100644 index 00000000000..f075b9cc80d --- /dev/null +++ b/samples/client/petstore/python/test/test_order.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.order import Order # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.order.Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_boolean.py b/samples/client/petstore/python/test/test_outer_boolean.py new file mode 100644 index 00000000000..6743c3c9d6c --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_boolean.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.outer_boolean import OuterBoolean # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOuterBoolean(unittest.TestCase): + """OuterBoolean unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterBoolean(self): + """Test OuterBoolean""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.outer_boolean.OuterBoolean() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_composite.py b/samples/client/petstore/python/test/test_outer_composite.py new file mode 100644 index 00000000000..7e691c12033 --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_composite.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.outer_composite import OuterComposite # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.outer_composite.OuterComposite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_enum.py b/samples/client/petstore/python/test/test_outer_enum.py new file mode 100644 index 00000000000..84530b49020 --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.outer_enum import OuterEnum # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.outer_enum.OuterEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_number.py b/samples/client/petstore/python/test/test_outer_number.py new file mode 100644 index 00000000000..a38ca6b3b4e --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_number.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.outer_number import OuterNumber # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOuterNumber(unittest.TestCase): + """OuterNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterNumber(self): + """Test OuterNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.outer_number.OuterNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_outer_string.py b/samples/client/petstore/python/test/test_outer_string.py new file mode 100644 index 00000000000..9a9e6b699cd --- /dev/null +++ b/samples/client/petstore/python/test/test_outer_string.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.outer_string import OuterString # noqa: E501 +from swagger_client.rest import ApiException + + +class TestOuterString(unittest.TestCase): + """OuterString unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterString(self): + """Test OuterString""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.outer_string.OuterString() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py new file mode 100644 index 00000000000..86f4849581b --- /dev/null +++ b/samples/client/petstore/python/test/test_pet.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.pet import Pet # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.pet.Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_pet_api.py b/samples/client/petstore/python/test/test_pet_api.py new file mode 100644 index 00000000000..e4e1d107107 --- /dev/null +++ b/samples/client/petstore/python/test/test_pet_api.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.pet_api import PetApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = api.pet_api.PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_all_pets(self): + """Test case for get_all_pets + + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_get_random_pet(self): + """Test case for get_random_pet + + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_read_only_first.py b/samples/client/petstore/python/test/test_read_only_first.py new file mode 100644 index 00000000000..73fe45f0410 --- /dev/null +++ b/samples/client/petstore/python/test/test_read_only_first.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.read_only_first import ReadOnlyFirst # noqa: E501 +from swagger_client.rest import ApiException + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.read_only_first.ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_single_pet_response.py b/samples/client/petstore/python/test/test_single_pet_response.py new file mode 100644 index 00000000000..e48ef148711 --- /dev/null +++ b/samples/client/petstore/python/test/test_single_pet_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.single_pet_response import SinglePetResponse # noqa: E501 +from swagger_client.rest import ApiException + + +class TestSinglePetResponse(unittest.TestCase): + """SinglePetResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSinglePetResponse(self): + """Test SinglePetResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.single_pet_response.SinglePetResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_special_model_name.py b/samples/client/petstore/python/test/test_special_model_name.py new file mode 100644 index 00000000000..130a49df04b --- /dev/null +++ b/samples/client/petstore/python/test/test_special_model_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.special_model_name import SpecialModelName # noqa: E501 +from swagger_client.rest import ApiException + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.special_model_name.SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_store_api.py b/samples/client/petstore/python/test/test_store_api.py new file mode 100644 index 00000000000..59f8f0e25d5 --- /dev/null +++ b/samples/client/petstore/python/test/test_store_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.store_api import StoreApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = api.store_api.StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_tag.py b/samples/client/petstore/python/test/test_tag.py new file mode 100644 index 00000000000..d51bff03bc6 --- /dev/null +++ b/samples/client/petstore/python/test/test_tag.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.tag import Tag # noqa: E501 +from swagger_client.rest import ApiException + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.tag.Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_user.py b/samples/client/petstore/python/test/test_user.py new file mode 100644 index 00000000000..7abf6b80dd9 --- /dev/null +++ b/samples/client/petstore/python/test/test_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from models.user import User # noqa: E501 +from swagger_client.rest import ApiException + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.user.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_user_api.py b/samples/client/petstore/python/test/test_user_api.py new file mode 100644 index 00000000000..01de4ca2643 --- /dev/null +++ b/samples/client/petstore/python/test/test_user_api.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from api.user_api import UserApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = api.user_api.UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/tox.ini b/samples/client/petstore/python/tox.ini new file mode 100644 index 00000000000..3d0be613cfc --- /dev/null +++ b/samples/client/petstore/python/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + []