forked from loafle/openapi-generator-original
[Python] Adds new client generator, python-experimental (#3244)
* Adds python-experimental generator * Adds python-experimental samples folder which uses its own v2 spec * Adds enusre-up-to-date updates * Removes samples/client/petstore/perl/t/AnotherFakeApiTest.t * Removes comment line from python-experimental generator * Reverts perl docs file * Updates perl sample client * Adds python-experimental to pom.xml * Copies the python test foldeers tests and testfiles into python-experimental * Copies python test folder into python-experimental * Moves python testing from Travis (samples pom.xml profile) to Circlci (samples.circleci pom.xml profile) * Adds python-experimental pom.xml * Adds python-experimental makefile and .sh files * Chenges python-experimental to use gitignored venv rather than .venv which is not ignored when testing * Adds dev-requiremnts.txt and removes .travis.yml from python-experimental so CI tests will pass * Moves python-experimental from CicleCI to Travis to get support for multiple python environments * Updates generator java comment so CI tests will run over again
This commit is contained in:
parent
78551d0180
commit
109808e60d
32
bin/python-experimental-petstore.sh
Executable file
32
bin/python-experimental-petstore.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=`ls -ld "$SCRIPT"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=`dirname "$SCRIPT"`/..
|
||||||
|
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package $@
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental -DpackageName=petstore_api $@"
|
||||||
|
|
||||||
|
java $JAVA_OPTS -jar $executable $ags
|
@ -43,6 +43,7 @@ The following generators are available:
|
|||||||
- [php](generators/php.md)
|
- [php](generators/php.md)
|
||||||
- [powershell](generators/powershell.md)
|
- [powershell](generators/powershell.md)
|
||||||
- [python](generators/python.md)
|
- [python](generators/python.md)
|
||||||
|
- [python-experimental](generators/python-experimental.md)
|
||||||
- [r](generators/r.md)
|
- [r](generators/r.md)
|
||||||
- [ruby](generators/ruby.md)
|
- [ruby](generators/ruby.md)
|
||||||
- [rust](generators/rust.md)
|
- [rust](generators/rust.md)
|
||||||
|
17
docs/generators/python-experimental.md
Normal file
17
docs/generators/python-experimental.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
id: generator-opts-client-python-experimental
|
||||||
|
title: Config Options for python-experimental
|
||||||
|
sidebar_label: python-experimental
|
||||||
|
---
|
||||||
|
|
||||||
|
| Option | Description | Values | Default |
|
||||||
|
| ------ | ----------- | ------ | ------- |
|
||||||
|
|packageName|python package name (convention: snake_case).| |openapi_client|
|
||||||
|
|projectName|python project name in setup.py (e.g. petstore-api).| |null|
|
||||||
|
|packageVersion|python package version.| |1.0.0|
|
||||||
|
|packageUrl|python package URL.| |null|
|
||||||
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||||
|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||||
|
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|
||||||
|
|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3|
|
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.openapitools.codegen.languages;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class PythonClientExperimentalCodegen extends PythonClientCodegen {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class);
|
||||||
|
|
||||||
|
public PythonClientExperimentalCodegen() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures a friendly name for the generator. This will be used by the
|
||||||
|
* generator to select the library with the -g flag.
|
||||||
|
*
|
||||||
|
* @return the friendly name for the generator
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "python-experimental";
|
||||||
|
}
|
||||||
|
}
|
@ -74,6 +74,7 @@ org.openapitools.codegen.languages.PhpSymfonyServerCodegen
|
|||||||
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
|
org.openapitools.codegen.languages.PhpZendExpressivePathHandlerServerCodegen
|
||||||
org.openapitools.codegen.languages.PowerShellClientCodegen
|
org.openapitools.codegen.languages.PowerShellClientCodegen
|
||||||
org.openapitools.codegen.languages.PythonClientCodegen
|
org.openapitools.codegen.languages.PythonClientCodegen
|
||||||
|
org.openapitools.codegen.languages.PythonClientExperimentalCodegen
|
||||||
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
org.openapitools.codegen.languages.PythonFlaskConnexionServerCodegen
|
||||||
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
|
org.openapitools.codegen.languages.PythonAiohttpConnexionServerCodegen
|
||||||
org.openapitools.codegen.languages.PythonBluePlanetServerCodegen
|
org.openapitools.codegen.languages.PythonBluePlanetServerCodegen
|
||||||
|
File diff suppressed because it is too large
Load Diff
1
pom.xml
1
pom.xml
@ -1041,6 +1041,7 @@
|
|||||||
<module>samples/client/petstore/javascript-promise-es6</module>
|
<module>samples/client/petstore/javascript-promise-es6</module>
|
||||||
<module>samples/client/petstore/javascript-flowtyped</module>
|
<module>samples/client/petstore/javascript-flowtyped</module>
|
||||||
<module>samples/client/petstore/python</module>
|
<module>samples/client/petstore/python</module>
|
||||||
|
<module>samples/client/petstore/python-experimental</module>
|
||||||
<module>samples/client/petstore/python-asyncio</module>
|
<module>samples/client/petstore/python-asyncio</module>
|
||||||
<module>samples/client/petstore/python-tornado</module>
|
<module>samples/client/petstore/python-tornado</module>
|
||||||
<module>samples/openapi3/client/petstore/python</module>
|
<module>samples/openapi3/client/petstore/python</module>
|
||||||
|
64
samples/client/petstore/python-experimental/.gitignore
vendored
Normal file
64
samples/client/petstore/python-experimental/.gitignore
vendored
Normal file
@ -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
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# 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 OpenAPI Generator 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
|
@ -0,0 +1 @@
|
|||||||
|
4.0.3-SNAPSHOT
|
14
samples/client/petstore/python-experimental/.travis.yml
Normal file
14
samples/client/petstore/python-experimental/.travis.yml
Normal file
@ -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
|
21
samples/client/petstore/python-experimental/Makefile
Normal file
21
samples/client/petstore/python-experimental/Makefile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
REQUIREMENTS_FILE=dev-requirements.txt
|
||||||
|
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||||
|
SETUP_OUT=*.egg-info
|
||||||
|
VENV=venv
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(REQUIREMENTS_OUT)
|
||||||
|
rm -rf $(SETUP_OUT)
|
||||||
|
rm -rf $(VENV)
|
||||||
|
rm -rf .tox
|
||||||
|
rm -rf .coverage
|
||||||
|
find . -name "*.py[oc]" -delete
|
||||||
|
find . -name "__pycache__" -delete
|
||||||
|
|
||||||
|
test: clean
|
||||||
|
bash ./test_python2.sh
|
||||||
|
|
||||||
|
test-all: clean
|
||||||
|
bash ./test_python2_and_3.sh
|
198
samples/client/petstore/python-experimental/README.md
Normal file
198
samples/client/petstore/python-experimental/README.md
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
# petstore-api
|
||||||
|
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 [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
|
- API version: 1.0.0
|
||||||
|
- Package version: 1.0.0
|
||||||
|
- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen
|
||||||
|
|
||||||
|
## 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 petstore_api
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 petstore_api
|
||||||
|
```
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration))
|
||||||
|
body = petstore_api.Client() # Client | client model
|
||||||
|
|
||||||
|
try:
|
||||||
|
# To test special tags
|
||||||
|
api_response = api_instance.call_123_test_special_tags(body)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
*FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
|
||||||
|
*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_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
|
||||||
|
*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_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
*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) | **GET** /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_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*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
|
||||||
|
*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
*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
|
||||||
|
|
||||||
|
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
|
||||||
|
- [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md)
|
||||||
|
- [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md)
|
||||||
|
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||||
|
- [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md)
|
||||||
|
- [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md)
|
||||||
|
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
|
||||||
|
- [AdditionalPropertiesString](docs/AdditionalPropertiesString.md)
|
||||||
|
- [Animal](docs/Animal.md)
|
||||||
|
- [ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||||
|
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||||
|
- [ArrayTest](docs/ArrayTest.md)
|
||||||
|
- [Capitalization](docs/Capitalization.md)
|
||||||
|
- [Cat](docs/Cat.md)
|
||||||
|
- [CatAllOf](docs/CatAllOf.md)
|
||||||
|
- [Category](docs/Category.md)
|
||||||
|
- [ClassModel](docs/ClassModel.md)
|
||||||
|
- [Client](docs/Client.md)
|
||||||
|
- [Dog](docs/Dog.md)
|
||||||
|
- [DogAllOf](docs/DogAllOf.md)
|
||||||
|
- [EnumArrays](docs/EnumArrays.md)
|
||||||
|
- [EnumClass](docs/EnumClass.md)
|
||||||
|
- [EnumTest](docs/EnumTest.md)
|
||||||
|
- [File](docs/File.md)
|
||||||
|
- [FileSchemaTestClass](docs/FileSchemaTestClass.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)
|
||||||
|
- [Order](docs/Order.md)
|
||||||
|
- [OuterComposite](docs/OuterComposite.md)
|
||||||
|
- [OuterEnum](docs/OuterEnum.md)
|
||||||
|
- [Pet](docs/Pet.md)
|
||||||
|
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||||
|
- [SpecialModelName](docs/SpecialModelName.md)
|
||||||
|
- [Tag](docs/Tag.md)
|
||||||
|
- [TypeHolderDefault](docs/TypeHolderDefault.md)
|
||||||
|
- [TypeHolderExample](docs/TypeHolderExample.md)
|
||||||
|
- [User](docs/User.md)
|
||||||
|
- [XmlItem](docs/XmlItem.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**:
|
||||||
|
- **write:pets**: modify pets in your account
|
||||||
|
- **read:pets**: read your pets
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
nose
|
||||||
|
tox
|
||||||
|
coverage
|
||||||
|
randomize
|
||||||
|
flake8
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesAnyType
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesArray
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesBoolean
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
# AdditionalPropertiesClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**map_string** | **dict(str, str)** | | [optional]
|
||||||
|
**map_number** | **dict(str, float)** | | [optional]
|
||||||
|
**map_integer** | **dict(str, int)** | | [optional]
|
||||||
|
**map_boolean** | **dict(str, bool)** | | [optional]
|
||||||
|
**map_array_integer** | **dict(str, list[int])** | | [optional]
|
||||||
|
**map_array_anytype** | **dict(str, list[object])** | | [optional]
|
||||||
|
**map_map_string** | **dict(str, dict(str, str))** | | [optional]
|
||||||
|
**map_map_anytype** | **dict(str, dict(str, object))** | | [optional]
|
||||||
|
**anytype_1** | [**object**](.md) | | [optional]
|
||||||
|
**anytype_2** | [**object**](.md) | | [optional]
|
||||||
|
**anytype_3** | [**object**](.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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesInteger
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesNumber
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesObject
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# AdditionalPropertiesString
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python-experimental/docs/Animal.md
Normal file
11
samples/client/petstore/python-experimental/docs/Animal.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
|||||||
|
# petstore_api.AnotherFakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
|
||||||
|
|
||||||
|
|
||||||
|
# **call_123_test_special_tags**
|
||||||
|
> Client call_123_test_special_tags(body)
|
||||||
|
|
||||||
|
To test special tags
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.AnotherFakeApi()
|
||||||
|
body = petstore_api.Client() # Client | client model
|
||||||
|
|
||||||
|
try:
|
||||||
|
# To test special tags
|
||||||
|
api_response = api_instance.call_123_test_special_tags(body)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling AnotherFakeApi->call_123_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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/Cat.md
Normal file
10
samples/client/petstore/python-experimental/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Cat
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/CatAllOf.md
Normal file
10
samples/client/petstore/python-experimental/docs/CatAllOf.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# CatAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
11
samples/client/petstore/python-experimental/docs/Category.md
Normal file
11
samples/client/petstore/python-experimental/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Category
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **int** | | [optional]
|
||||||
|
**name** | **str** | | [default to 'default-name']
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/Client.md
Normal file
10
samples/client/petstore/python-experimental/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/Dog.md
Normal file
10
samples/client/petstore/python-experimental/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Dog
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/DogAllOf.md
Normal file
10
samples/client/petstore/python-experimental/docs/DogAllOf.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# DogAllOf
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
14
samples/client/petstore/python-experimental/docs/EnumTest.md
Normal file
14
samples/client/petstore/python-experimental/docs/EnumTest.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# EnumTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**enum_string** | **str** | | [optional]
|
||||||
|
**enum_string_required** | **str** | |
|
||||||
|
**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)
|
||||||
|
|
||||||
|
|
764
samples/client/petstore/python-experimental/docs/FakeApi.md
Normal file
764
samples/client/petstore/python-experimental/docs/FakeApi.md
Normal file
@ -0,0 +1,764 @@
|
|||||||
|
# petstore_api.FakeApi
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
|
||||||
|
[**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_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
|
||||||
|
[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
|
||||||
|
[**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_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||||
|
[**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) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||||
|
|
||||||
|
|
||||||
|
# **create_xml_item**
|
||||||
|
> create_xml_item(xml_item)
|
||||||
|
|
||||||
|
creates an XmlItem
|
||||||
|
|
||||||
|
this route creates an XmlItem
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body
|
||||||
|
|
||||||
|
try:
|
||||||
|
# creates an XmlItem
|
||||||
|
api_instance.create_xml_item(xml_item)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->create_xml_item: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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_boolean_serialize**
|
||||||
|
> bool fake_outer_boolean_serialize(body=body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer boolean types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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**| Input boolean as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**bool**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Output boolean | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
body = petstore_api.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**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Output composite | - |
|
||||||
|
|
||||||
|
[[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**
|
||||||
|
> float fake_outer_number_serialize(body=body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer number types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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**| Input number as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**float**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Output number | - |
|
||||||
|
|
||||||
|
[[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**
|
||||||
|
> str fake_outer_string_serialize(body=body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Test serialization of outer string types
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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**| Input string as post body | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**str**
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: */*
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Output string | - |
|
||||||
|
|
||||||
|
[[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_body_with_file_schema**
|
||||||
|
> test_body_with_file_schema(body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
For this test, the body for this request much reference a schema named `File`.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
|
||||||
|
|
||||||
|
try:
|
||||||
|
api_instance.test_body_with_file_schema(body)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Success | - |
|
||||||
|
|
||||||
|
[[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_body_with_query_params**
|
||||||
|
> test_body_with_query_params(query, body)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
query = 'query_example' # str |
|
||||||
|
body = petstore_api.User() # User |
|
||||||
|
|
||||||
|
try:
|
||||||
|
api_instance.test_body_with_query_params(query, body)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**query** | **str**| |
|
||||||
|
**body** | [**User**](User.md)| |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | Success | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
body = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
* Basic Authentication (http_basic_test):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure HTTP basic authorization: http_basic_test
|
||||||
|
configuration.username = 'YOUR_USERNAME'
|
||||||
|
configuration.password = 'YOUR_PASSWORD'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration))
|
||||||
|
number = 3.4 # float | None
|
||||||
|
double = 3.4 # float | None
|
||||||
|
pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
|
||||||
|
byte = 'byte_example' # str | None
|
||||||
|
integer = 56 # int | None (optional)
|
||||||
|
int32 = 56 # int | None (optional)
|
||||||
|
int64 = 56 # int | None (optional)
|
||||||
|
float = 3.4 # float | None (optional)
|
||||||
|
string = 'string_example' # str | None (optional)
|
||||||
|
binary = '/path/to/file' # file | None (optional)
|
||||||
|
date = '2013-10-20' # date | None (optional)
|
||||||
|
date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
|
||||||
|
password = 'password_example' # str | None (optional)
|
||||||
|
param_callback = 'param_callback_example' # str | None (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**number** | **float**| None |
|
||||||
|
**double** | **float**| None |
|
||||||
|
**pattern_without_delimiter** | **str**| None |
|
||||||
|
**byte** | **str**| None |
|
||||||
|
**integer** | **int**| None | [optional]
|
||||||
|
**int32** | **int**| None | [optional]
|
||||||
|
**int64** | **int**| None | [optional]
|
||||||
|
**float** | **float**| None | [optional]
|
||||||
|
**string** | **str**| None | [optional]
|
||||||
|
**binary** | **file**| None | [optional]
|
||||||
|
**date** | **date**| None | [optional]
|
||||||
|
**date_time** | **datetime**| None | [optional]
|
||||||
|
**password** | **str**| None | [optional]
|
||||||
|
**param_callback** | **str**| None | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[http_basic_test](../README.md#http_basic_test)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Invalid username supplied | - |
|
||||||
|
**404** | User not found | - |
|
||||||
|
|
||||||
|
[[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, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
To test enum parameters
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional)
|
||||||
|
enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg')
|
||||||
|
enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional)
|
||||||
|
enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg')
|
||||||
|
enum_query_integer = 56 # int | Query parameter enum test (double) (optional)
|
||||||
|
enum_query_double = 3.4 # float | Query parameter enum test (double) (optional)
|
||||||
|
enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$')
|
||||||
|
enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg')
|
||||||
|
|
||||||
|
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, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string)
|
||||||
|
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] [default to '-efg']
|
||||||
|
**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] [default to '-efg']
|
||||||
|
**enum_query_integer** | **int**| Query parameter enum test (double) | [optional]
|
||||||
|
**enum_query_double** | **float**| Query parameter enum test (double) | [optional]
|
||||||
|
**enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$']
|
||||||
|
**enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Invalid request | - |
|
||||||
|
**404** | Not found | - |
|
||||||
|
|
||||||
|
[[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_group_parameters**
|
||||||
|
> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
|
|
||||||
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
required_string_group = 56 # int | Required String in group parameters
|
||||||
|
required_boolean_group = True # bool | Required Boolean in group parameters
|
||||||
|
required_int64_group = 56 # int | Required Integer in group parameters
|
||||||
|
string_group = 56 # int | String in group parameters (optional)
|
||||||
|
boolean_group = True # bool | Boolean in group parameters (optional)
|
||||||
|
int64_group = 56 # int | Integer in group parameters (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Fake endpoint to test group parameters (optional)
|
||||||
|
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**required_string_group** | **int**| Required String in group parameters |
|
||||||
|
**required_boolean_group** | **bool**| Required Boolean in group parameters |
|
||||||
|
**required_int64_group** | **int**| Required Integer in group parameters |
|
||||||
|
**string_group** | **int**| String in group parameters | [optional]
|
||||||
|
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
||||||
|
**int64_group** | **int**| Integer in group parameters | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Someting wrong | - |
|
||||||
|
|
||||||
|
[[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(param)
|
||||||
|
|
||||||
|
test inline additionalProperties
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
param = {'key': 'param_example'} # dict(str, str) | request body
|
||||||
|
|
||||||
|
try:
|
||||||
|
# test inline additionalProperties
|
||||||
|
api_instance.test_inline_additional_properties(param)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | [**dict(str, str)**](str.md)| request body |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/json
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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(param, param2)
|
||||||
|
|
||||||
|
test json serialization of form data
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.FakeApi()
|
||||||
|
param = 'param_example' # str | field1
|
||||||
|
param2 = 'param2_example' # str | field2
|
||||||
|
|
||||||
|
try:
|
||||||
|
# test json serialization of form data
|
||||||
|
api_instance.test_json_form_data(param, param2)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**param** | **str**| field1 |
|
||||||
|
**param2** | **str**| field2 |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: application/x-www-form-urlencoded
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,69 @@
|
|||||||
|
# petstore_api.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
|
||||||
|
|
||||||
|
To test class name in snake case
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
* Api Key Authentication (api_key_query):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure API key authorization: api_key_query
|
||||||
|
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 = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration))
|
||||||
|
body = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/File.md
Normal file
10
samples/client/petstore/python-experimental/docs/File.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# File
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**source_uri** | **str** | Test capitalization | [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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# FileSchemaTestClass
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**file** | [**File**](File.md) | | [optional]
|
||||||
|
**files** | [**list[File]**](File.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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
# 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** | **file** | | [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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
10
samples/client/petstore/python-experimental/docs/List.md
Normal file
10
samples/client/petstore/python-experimental/docs/List.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
13
samples/client/petstore/python-experimental/docs/MapTest.md
Normal file
13
samples/client/petstore/python-experimental/docs/MapTest.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# MapTest
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
|
||||||
|
**map_of_enum_string** | **dict(str, str)** | | [optional]
|
||||||
|
**direct_map** | **dict(str, bool)** | | [optional]
|
||||||
|
**indirect_map** | **dict(str, 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
13
samples/client/petstore/python-experimental/docs/Name.md
Normal file
13
samples/client/petstore/python-experimental/docs/Name.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/python-experimental/docs/Order.md
Normal file
15
samples/client/petstore/python-experimental/docs/Order.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# OuterComposite
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**my_number** | **float** | | [optional]
|
||||||
|
**my_string** | **str** | | [optional]
|
||||||
|
**my_boolean** | **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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/python-experimental/docs/Pet.md
Normal file
15
samples/client/petstore/python-experimental/docs/Pet.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
548
samples/client/petstore/python-experimental/docs/PetApi.md
Normal file
548
samples/client/petstore/python-experimental/docs/PetApi.md
Normal file
@ -0,0 +1,548 @@
|
|||||||
|
# petstore_api.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_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
[**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
|
||||||
|
[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||||
|
|
||||||
|
|
||||||
|
# **add_pet**
|
||||||
|
> add_pet(body)
|
||||||
|
|
||||||
|
Add a new pet to the store
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
body = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**405** | Invalid input | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
pet_id = 56 # int | 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid pet value | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid status value | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid tag value | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* Api Key Authentication (api_key):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
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 = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
pet_id = 56 # 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid ID supplied | - |
|
||||||
|
**404** | Pet not found | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
body = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid ID supplied | - |
|
||||||
|
**404** | Pet not found | - |
|
||||||
|
**405** | Validation exception | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
pet_id = 56 # int | ID of pet that needs to be updated
|
||||||
|
name = 'name_example' # str | Updated name of the pet (optional)
|
||||||
|
status = 'status_example' # str | Updated status of the pet (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**| Updated name of the pet | [optional]
|
||||||
|
**status** | **str**| Updated status of the pet | [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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**405** | Invalid input | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
pet_id = 56 # int | ID of pet to update
|
||||||
|
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
|
||||||
|
file = '/path/to/file' # file | file to upload (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**| Additional data to pass to server | [optional]
|
||||||
|
**file** | **file**| file to upload | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **upload_file_with_required_file**
|
||||||
|
> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
|
||||||
|
|
||||||
|
uploads an image (required)
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
* OAuth Authentication (petstore_auth):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure OAuth2 access token for authorization: petstore_auth
|
||||||
|
configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
|
||||||
|
pet_id = 56 # int | ID of pet to update
|
||||||
|
required_file = '/path/to/file' # file | file to upload
|
||||||
|
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# uploads an image (required)
|
||||||
|
api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
|
||||||
|
pprint(api_response)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**pet_id** | **int**| ID of pet to update |
|
||||||
|
**required_file** | **file**| file to upload |
|
||||||
|
**additional_metadata** | **str**| Additional data to pass to server | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**ApiResponse**](ApiResponse.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[petstore_auth](../README.md#petstore_auth)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: multipart/form-data
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
231
samples/client/petstore/python-experimental/docs/StoreApi.md
Normal file
231
samples/client/petstore/python-experimental/docs/StoreApi.md
Normal file
@ -0,0 +1,231 @@
|
|||||||
|
# petstore_api.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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Invalid ID supplied | - |
|
||||||
|
**404** | Order not found | - |
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* Api Key Authentication (api_key):
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
configuration = petstore_api.Configuration()
|
||||||
|
# Configure API key authorization: api_key
|
||||||
|
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 = petstore_api.StoreApi(petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.StoreApi()
|
||||||
|
order_id = 56 # 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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid ID supplied | - |
|
||||||
|
**404** | Order not found | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.StoreApi()
|
||||||
|
body = petstore_api.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**: Not defined
|
||||||
|
- **Accept**: application/xml, application/json
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid Order | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
11
samples/client/petstore/python-experimental/docs/Tag.md
Normal file
11
samples/client/petstore/python-experimental/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# TypeHolderDefault
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**string_item** | **str** | | [default to 'what']
|
||||||
|
**number_item** | **float** | |
|
||||||
|
**integer_item** | **int** | |
|
||||||
|
**bool_item** | **bool** | | [default to True]
|
||||||
|
**array_item** | **list[int]** | |
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
# TypeHolderExample
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**string_item** | **str** | |
|
||||||
|
**number_item** | **float** | |
|
||||||
|
**integer_item** | **int** | |
|
||||||
|
**bool_item** | **bool** | |
|
||||||
|
**array_item** | **list[int]** | |
|
||||||
|
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
17
samples/client/petstore/python-experimental/docs/User.md
Normal file
17
samples/client/petstore/python-experimental/docs/User.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
|
437
samples/client/petstore/python-experimental/docs/UserApi.md
Normal file
437
samples/client/petstore/python-experimental/docs/UserApi.md
Normal file
@ -0,0 +1,437 @@
|
|||||||
|
# petstore_api.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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.UserApi()
|
||||||
|
body = petstore_api.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**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.UserApi()
|
||||||
|
body = [petstore_api.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**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.UserApi()
|
||||||
|
body = [petstore_api.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**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Invalid username supplied | - |
|
||||||
|
**404** | User not found | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | - |
|
||||||
|
**400** | Invalid username supplied | - |
|
||||||
|
**404** | User not found | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||||
|
**400** | Invalid username/password supplied | - |
|
||||||
|
|
||||||
|
[[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 petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.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
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**0** | successful operation | - |
|
||||||
|
|
||||||
|
[[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(username, body)
|
||||||
|
|
||||||
|
Updated user
|
||||||
|
|
||||||
|
This can only be done by the logged in user.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```python
|
||||||
|
from __future__ import print_function
|
||||||
|
import time
|
||||||
|
import petstore_api
|
||||||
|
from petstore_api.rest import ApiException
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
# create an instance of the API class
|
||||||
|
api_instance = petstore_api.UserApi()
|
||||||
|
username = 'username_example' # str | name that need to be deleted
|
||||||
|
body = petstore_api.User() # User | Updated user object
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Updated user
|
||||||
|
api_instance.update_user(username, body)
|
||||||
|
except ApiException as e:
|
||||||
|
print("Exception when calling UserApi->update_user: %s\n" % e)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**username** | **str**| name that need to be deleted |
|
||||||
|
**body** | [**User**](User.md)| Updated user object |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
**400** | Invalid user supplied | - |
|
||||||
|
**404** | User not found | - |
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
38
samples/client/petstore/python-experimental/docs/XmlItem.md
Normal file
38
samples/client/petstore/python-experimental/docs/XmlItem.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# XmlItem
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**attribute_string** | **str** | | [optional]
|
||||||
|
**attribute_number** | **float** | | [optional]
|
||||||
|
**attribute_integer** | **int** | | [optional]
|
||||||
|
**attribute_boolean** | **bool** | | [optional]
|
||||||
|
**wrapped_array** | **list[int]** | | [optional]
|
||||||
|
**name_string** | **str** | | [optional]
|
||||||
|
**name_number** | **float** | | [optional]
|
||||||
|
**name_integer** | **int** | | [optional]
|
||||||
|
**name_boolean** | **bool** | | [optional]
|
||||||
|
**name_array** | **list[int]** | | [optional]
|
||||||
|
**name_wrapped_array** | **list[int]** | | [optional]
|
||||||
|
**prefix_string** | **str** | | [optional]
|
||||||
|
**prefix_number** | **float** | | [optional]
|
||||||
|
**prefix_integer** | **int** | | [optional]
|
||||||
|
**prefix_boolean** | **bool** | | [optional]
|
||||||
|
**prefix_array** | **list[int]** | | [optional]
|
||||||
|
**prefix_wrapped_array** | **list[int]** | | [optional]
|
||||||
|
**namespace_string** | **str** | | [optional]
|
||||||
|
**namespace_number** | **float** | | [optional]
|
||||||
|
**namespace_integer** | **int** | | [optional]
|
||||||
|
**namespace_boolean** | **bool** | | [optional]
|
||||||
|
**namespace_array** | **list[int]** | | [optional]
|
||||||
|
**namespace_wrapped_array** | **list[int]** | | [optional]
|
||||||
|
**prefix_ns_string** | **str** | | [optional]
|
||||||
|
**prefix_ns_number** | **float** | | [optional]
|
||||||
|
**prefix_ns_integer** | **int** | | [optional]
|
||||||
|
**prefix_ns_boolean** | **bool** | | [optional]
|
||||||
|
**prefix_ns_array** | **list[int]** | | [optional]
|
||||||
|
**prefix_ns_wrapped_array** | **list[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)
|
||||||
|
|
||||||
|
|
52
samples/client/petstore/python-experimental/git_push.sh
Normal file
52
samples/client/petstore/python-experimental/git_push.sh
Normal file
@ -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 openapi-pestore-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'
|
||||||
|
|
@ -0,0 +1,82 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
|
||||||
|
# import apis into sdk package
|
||||||
|
from petstore_api.api.another_fake_api import AnotherFakeApi
|
||||||
|
from petstore_api.api.fake_api import FakeApi
|
||||||
|
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
|
||||||
|
from petstore_api.api.pet_api import PetApi
|
||||||
|
from petstore_api.api.store_api import StoreApi
|
||||||
|
from petstore_api.api.user_api import UserApi
|
||||||
|
|
||||||
|
# import ApiClient
|
||||||
|
from petstore_api.api_client import ApiClient
|
||||||
|
from petstore_api.configuration import Configuration
|
||||||
|
from petstore_api.exceptions import OpenApiException
|
||||||
|
from petstore_api.exceptions import ApiTypeError
|
||||||
|
from petstore_api.exceptions import ApiValueError
|
||||||
|
from petstore_api.exceptions import ApiKeyError
|
||||||
|
from petstore_api.exceptions import ApiException
|
||||||
|
# import models into sdk package
|
||||||
|
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||||
|
from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
|
||||||
|
from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
|
||||||
|
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||||
|
from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
|
||||||
|
from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
|
||||||
|
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||||
|
from petstore_api.models.additional_properties_string import AdditionalPropertiesString
|
||||||
|
from petstore_api.models.animal import Animal
|
||||||
|
from petstore_api.models.api_response import ApiResponse
|
||||||
|
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
|
||||||
|
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
|
||||||
|
from petstore_api.models.array_test import ArrayTest
|
||||||
|
from petstore_api.models.capitalization import Capitalization
|
||||||
|
from petstore_api.models.cat import Cat
|
||||||
|
from petstore_api.models.cat_all_of import CatAllOf
|
||||||
|
from petstore_api.models.category import Category
|
||||||
|
from petstore_api.models.class_model import ClassModel
|
||||||
|
from petstore_api.models.client import Client
|
||||||
|
from petstore_api.models.dog import Dog
|
||||||
|
from petstore_api.models.dog_all_of import DogAllOf
|
||||||
|
from petstore_api.models.enum_arrays import EnumArrays
|
||||||
|
from petstore_api.models.enum_class import EnumClass
|
||||||
|
from petstore_api.models.enum_test import EnumTest
|
||||||
|
from petstore_api.models.file import File
|
||||||
|
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
|
||||||
|
from petstore_api.models.format_test import FormatTest
|
||||||
|
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
|
||||||
|
from petstore_api.models.list import List
|
||||||
|
from petstore_api.models.map_test import MapTest
|
||||||
|
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
from petstore_api.models.model200_response import Model200Response
|
||||||
|
from petstore_api.models.model_return import ModelReturn
|
||||||
|
from petstore_api.models.name import Name
|
||||||
|
from petstore_api.models.number_only import NumberOnly
|
||||||
|
from petstore_api.models.order import Order
|
||||||
|
from petstore_api.models.outer_composite import OuterComposite
|
||||||
|
from petstore_api.models.outer_enum import OuterEnum
|
||||||
|
from petstore_api.models.pet import Pet
|
||||||
|
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||||
|
from petstore_api.models.special_model_name import SpecialModelName
|
||||||
|
from petstore_api.models.tag import Tag
|
||||||
|
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||||
|
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||||
|
from petstore_api.models.user import User
|
||||||
|
from petstore_api.models.xml_item import XmlItem
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
|
||||||
|
# import apis into api package
|
||||||
|
from petstore_api.api.another_fake_api import AnotherFakeApi
|
||||||
|
from petstore_api.api.fake_api import FakeApi
|
||||||
|
from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api
|
||||||
|
from petstore_api.api.pet_api import PetApi
|
||||||
|
from petstore_api.api.store_api import StoreApi
|
||||||
|
from petstore_api.api.user_api import UserApi
|
@ -0,0 +1,149 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
# python 2 and python 3 compatibility library
|
||||||
|
import six
|
||||||
|
|
||||||
|
from petstore_api.api_client import ApiClient
|
||||||
|
from petstore_api.exceptions import (
|
||||||
|
ApiTypeError,
|
||||||
|
ApiValueError
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class AnotherFakeApi(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, api_client=None):
|
||||||
|
if api_client is None:
|
||||||
|
api_client = ApiClient()
|
||||||
|
self.api_client = api_client
|
||||||
|
|
||||||
|
def call_123_test_special_tags(self, body, **kwargs): # noqa: E501
|
||||||
|
"""To test special tags # noqa: E501
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number # noqa: E501
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
>>> thread = api.call_123_test_special_tags(body, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req bool: execute request asynchronously
|
||||||
|
:param Client body: client model (required)
|
||||||
|
: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: Client
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501
|
||||||
|
"""To test special tags # noqa: E501
|
||||||
|
|
||||||
|
To test special tags and operation ID starting with number # noqa: E501
|
||||||
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
|
asynchronous HTTP request, please pass async_req=True
|
||||||
|
>>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req bool: execute request asynchronously
|
||||||
|
:param Client body: client model (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(Client, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method call_123_test_special_tags" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
|
||||||
|
query_params = []
|
||||||
|
|
||||||
|
header_params = {}
|
||||||
|
|
||||||
|
form_params = []
|
||||||
|
local_var_files = {}
|
||||||
|
|
||||||
|
body_params = None
|
||||||
|
if 'body' in local_var_params:
|
||||||
|
body_params = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
|
collection_formats=collection_formats)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,149 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
# python 2 and python 3 compatibility library
|
||||||
|
import six
|
||||||
|
|
||||||
|
from petstore_api.api_client import ApiClient
|
||||||
|
from petstore_api.exceptions import (
|
||||||
|
ApiTypeError,
|
||||||
|
ApiValueError
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class FakeClassnameTags123Api(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param Client body: client model (required)
|
||||||
|
: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: Client
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.test_classname_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
def test_classname_with_http_info(self, body, **kwargs): # noqa: E501
|
||||||
|
"""To test class name in snake case # 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: execute request asynchronously
|
||||||
|
:param Client body: client model (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(Client, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method test_classname" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("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 local_var_params:
|
||||||
|
body_params = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
|
collection_formats=collection_formats)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,459 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
# python 2 and python 3 compatibility library
|
||||||
|
import six
|
||||||
|
|
||||||
|
from petstore_api.api_client import ApiClient
|
||||||
|
from petstore_api.exceptions import (
|
||||||
|
ApiTypeError,
|
||||||
|
ApiValueError
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class StoreApi(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param str order_id: ID of the order that needs to be deleted (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param str order_id: ID of the order that needs to be deleted (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method delete_order" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'order_id' is set
|
||||||
|
if ('order_id' not in local_var_params or
|
||||||
|
local_var_params['order_id'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
if 'order_id' in local_var_params:
|
||||||
|
path_params['order_id'] = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
: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: dict(str, int)
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.get_inventory_with_http_info(**kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_inventory" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param int order_id: ID of pet that needs to be fetched (required)
|
||||||
|
: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: Order
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param int order_id: ID of pet that needs to be fetched (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(Order, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_order_by_id" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'order_id' is set
|
||||||
|
if ('order_id' not in local_var_params or
|
||||||
|
local_var_params['order_id'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501
|
||||||
|
|
||||||
|
if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501
|
||||||
|
raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501
|
||||||
|
if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501
|
||||||
|
raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
if 'order_id' in local_var_params:
|
||||||
|
path_params['order_id'] = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param Order body: order placed for purchasing the pet (required)
|
||||||
|
: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: Order
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.place_order_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param Order body: order placed for purchasing the pet (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(Order, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method place_order" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("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 local_var_params:
|
||||||
|
body_params = local_var_params['body']
|
||||||
|
# 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', '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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
|
collection_formats=collection_formats)
|
@ -0,0 +1,875 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
# python 2 and python 3 compatibility library
|
||||||
|
import six
|
||||||
|
|
||||||
|
from petstore_api.api_client import ApiClient
|
||||||
|
from petstore_api.exceptions import (
|
||||||
|
ApiTypeError,
|
||||||
|
ApiValueError
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class UserApi(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param User body: Created user object (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.create_user_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param User body: Created user object (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method create_user" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("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 local_var_params:
|
||||||
|
body_params = local_var_params['body']
|
||||||
|
# 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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param list[User] body: List of user object (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param list[User] body: List of user object (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method create_users_with_array_input" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("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 local_var_params:
|
||||||
|
body_params = local_var_params['body']
|
||||||
|
# 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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param list[User] body: List of user object (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param list[User] body: List of user object (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method create_users_with_list_input" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("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 local_var_params:
|
||||||
|
body_params = local_var_params['body']
|
||||||
|
# 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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param str username: The name that needs to be deleted (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.delete_user_with_http_info(username, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param str username: The name that needs to be deleted (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method delete_user" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'username' is set
|
||||||
|
if ('username' not in local_var_params or
|
||||||
|
local_var_params['username'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
if 'username' in local_var_params:
|
||||||
|
path_params['username'] = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
: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: User
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(User, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method get_user_by_name" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'username' is set
|
||||||
|
if ('username' not in local_var_params or
|
||||||
|
local_var_params['username'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
if 'username' in local_var_params:
|
||||||
|
path_params['username'] = local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
:param str username: The user name for login (required)
|
||||||
|
:param str password: The password for login in clear text (required)
|
||||||
|
: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: str
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param str username: The user name for login (required)
|
||||||
|
:param str password: The password for login in clear text (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: tuple(str, status_code(int), headers(HTTPHeaderDict))
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method login_user" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'username' is set
|
||||||
|
if ('username' not in local_var_params or
|
||||||
|
local_var_params['username'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501
|
||||||
|
# verify the required parameter 'password' is set
|
||||||
|
if ('password' not in local_var_params or
|
||||||
|
local_var_params['password'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
|
||||||
|
query_params = []
|
||||||
|
if 'username' in local_var_params:
|
||||||
|
query_params.append(('username', local_var_params['username'])) # noqa: E501
|
||||||
|
if 'password' in local_var_params:
|
||||||
|
query_params.append(('password', local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_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: execute request asynchronously
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.logout_user_with_http_info(**kwargs) # noqa: E501
|
||||||
|
|
||||||
|
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: execute request asynchronously
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method logout_user" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
|
collection_formats=collection_formats)
|
||||||
|
|
||||||
|
def update_user(self, username, body, **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(username, body, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req bool: execute request asynchronously
|
||||||
|
:param str username: name that need to be deleted (required)
|
||||||
|
:param User body: Updated user object (required)
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
kwargs['_return_http_data_only'] = True
|
||||||
|
return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501
|
||||||
|
|
||||||
|
def update_user_with_http_info(self, username, body, **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(username, body, async_req=True)
|
||||||
|
>>> result = thread.get()
|
||||||
|
|
||||||
|
:param async_req bool: execute request asynchronously
|
||||||
|
:param str username: name that need to be deleted (required)
|
||||||
|
:param User body: Updated user object (required)
|
||||||
|
:param _return_http_data_only: response data without head status code
|
||||||
|
and headers
|
||||||
|
: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: None
|
||||||
|
If the method is called asynchronously,
|
||||||
|
returns the request thread.
|
||||||
|
"""
|
||||||
|
|
||||||
|
local_var_params = locals()
|
||||||
|
|
||||||
|
all_params = ['username', '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')
|
||||||
|
|
||||||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
|
if key not in all_params:
|
||||||
|
raise ApiTypeError(
|
||||||
|
"Got an unexpected keyword argument '%s'"
|
||||||
|
" to method update_user" % key
|
||||||
|
)
|
||||||
|
local_var_params[key] = val
|
||||||
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'username' is set
|
||||||
|
if ('username' not in local_var_params or
|
||||||
|
local_var_params['username'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501
|
||||||
|
# verify the required parameter 'body' is set
|
||||||
|
if ('body' not in local_var_params or
|
||||||
|
local_var_params['body'] is None):
|
||||||
|
raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501
|
||||||
|
|
||||||
|
collection_formats = {}
|
||||||
|
|
||||||
|
path_params = {}
|
||||||
|
if 'username' in local_var_params:
|
||||||
|
path_params['username'] = local_var_params['username'] # noqa: E501
|
||||||
|
|
||||||
|
query_params = []
|
||||||
|
|
||||||
|
header_params = {}
|
||||||
|
|
||||||
|
form_params = []
|
||||||
|
local_var_files = {}
|
||||||
|
|
||||||
|
body_params = None
|
||||||
|
if 'body' in local_var_params:
|
||||||
|
body_params = local_var_params['body']
|
||||||
|
# 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=local_var_params.get('async_req'),
|
||||||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
|
collection_formats=collection_formats)
|
@ -0,0 +1,640 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
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 petstore_api.configuration import Configuration
|
||||||
|
import petstore_api.models
|
||||||
|
from petstore_api import rest
|
||||||
|
from petstore_api.exceptions import ApiValueError
|
||||||
|
|
||||||
|
|
||||||
|
class ApiClient(object):
|
||||||
|
"""Generic API client for OpenAPI client library builds.
|
||||||
|
|
||||||
|
OpenAPI 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 OpenAPI
|
||||||
|
templates.
|
||||||
|
|
||||||
|
NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
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
|
||||||
|
:param pool_threads: The number of threads to use for async requests
|
||||||
|
to the API. More threads means more concurrent API requests.
|
||||||
|
"""
|
||||||
|
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
_pool = None
|
||||||
|
|
||||||
|
def __init__(self, configuration=None, header_name=None, header_value=None,
|
||||||
|
cookie=None, pool_threads=1):
|
||||||
|
if configuration is None:
|
||||||
|
configuration = Configuration()
|
||||||
|
self.configuration = configuration
|
||||||
|
self.pool_threads = pool_threads
|
||||||
|
|
||||||
|
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 = 'OpenAPI-Generator/1.0.0/python'
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
if self._pool:
|
||||||
|
self._pool.close()
|
||||||
|
self._pool.join()
|
||||||
|
self._pool = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def pool(self):
|
||||||
|
"""Create thread pool on first request
|
||||||
|
avoids instantiating unused threadpool for blocking clients.
|
||||||
|
"""
|
||||||
|
if self._pool is None:
|
||||||
|
self._pool = ThreadPool(self.pool_threads)
|
||||||
|
return self._pool
|
||||||
|
|
||||||
|
@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, _host=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 = post_params if post_params else []
|
||||||
|
post_params = self.sanitize_for_serialization(post_params)
|
||||||
|
post_params = self.parameters_to_tuples(post_params,
|
||||||
|
collection_formats)
|
||||||
|
post_params.extend(self.files_parameters(files))
|
||||||
|
|
||||||
|
# auth setting
|
||||||
|
self.update_params_for_auth(header_params, query_params, auth_settings)
|
||||||
|
|
||||||
|
# body
|
||||||
|
if body:
|
||||||
|
body = self.sanitize_for_serialization(body)
|
||||||
|
|
||||||
|
# request url
|
||||||
|
if _host is None:
|
||||||
|
url = self.configuration.host + resource_path
|
||||||
|
else:
|
||||||
|
# use server/host defined in path or operation instead
|
||||||
|
url = _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 OpenAPI 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 `openapi_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.openapi_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(petstore_api.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, _host=None):
|
||||||
|
"""Makes the HTTP request (synchronous) and returns deserialized data.
|
||||||
|
|
||||||
|
To make an async_req 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, _host)
|
||||||
|
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,
|
||||||
|
_host))
|
||||||
|
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 ApiValueError(
|
||||||
|
"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 files_parameters(self, files=None):
|
||||||
|
"""Builds form parameters.
|
||||||
|
|
||||||
|
:param files: File parameters.
|
||||||
|
:return: Form parameters with files.
|
||||||
|
"""
|
||||||
|
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'] == 'cookie':
|
||||||
|
headers['Cookie'] = auth_setting['value']
|
||||||
|
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 ApiValueError(
|
||||||
|
'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 an 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 __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.openapi_types and not hasattr(klass,
|
||||||
|
'get_real_child_model'):
|
||||||
|
return data
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
if klass.openapi_types is not None:
|
||||||
|
for attr, attr_type in six.iteritems(klass.openapi_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 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
|
@ -0,0 +1,342 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
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, **kwargs):
|
||||||
|
if cls._default is None:
|
||||||
|
cls._default = type.__call__(cls, **kwargs)
|
||||||
|
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 OpenAPI Generator
|
||||||
|
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
Do not edit the class manually.
|
||||||
|
|
||||||
|
:param host: Base url
|
||||||
|
:param api_key: Dict to store API key(s)
|
||||||
|
:param api_key_prefix: Dict to store API prefix (e.g. Bearer)
|
||||||
|
:param username: Username for HTTP basic authentication
|
||||||
|
:param password: Password for HTTP basic authentication
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, host="http://petstore.swagger.io:80/v2",
|
||||||
|
api_key={}, api_key_prefix={},
|
||||||
|
username="", password=""):
|
||||||
|
"""Constructor
|
||||||
|
"""
|
||||||
|
self.host = host
|
||||||
|
"""Default Base url
|
||||||
|
"""
|
||||||
|
self.temp_folder_path = None
|
||||||
|
"""Temp file folder for downloading files
|
||||||
|
"""
|
||||||
|
# Authentication Settings
|
||||||
|
self.api_key = api_key
|
||||||
|
"""dict to store API key(s)
|
||||||
|
"""
|
||||||
|
self.api_key_prefix = api_key_prefix
|
||||||
|
"""dict to store API prefix (e.g. Bearer)
|
||||||
|
"""
|
||||||
|
self.username = username
|
||||||
|
"""Username for HTTP basic authentication
|
||||||
|
"""
|
||||||
|
self.password = password
|
||||||
|
"""Password for HTTP basic authentication
|
||||||
|
"""
|
||||||
|
self.access_token = ""
|
||||||
|
"""access token for OAuth/Bearer
|
||||||
|
"""
|
||||||
|
self.logger = {}
|
||||||
|
"""Logging Settings
|
||||||
|
"""
|
||||||
|
self.logger["package_logger"] = logging.getLogger("petstore_api")
|
||||||
|
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
||||||
|
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
||||||
|
"""Log format
|
||||||
|
"""
|
||||||
|
self.logger_stream_handler = None
|
||||||
|
"""Log stream handler
|
||||||
|
"""
|
||||||
|
self.logger_file_handler = None
|
||||||
|
"""Log file handler
|
||||||
|
"""
|
||||||
|
self.logger_file = None
|
||||||
|
"""Debug file location
|
||||||
|
"""
|
||||||
|
self.debug = False
|
||||||
|
"""Debug switch
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.verify_ssl = True
|
||||||
|
"""SSL/TLS verification
|
||||||
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
|
from https server.
|
||||||
|
"""
|
||||||
|
self.ssl_ca_cert = None
|
||||||
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
|
"""
|
||||||
|
self.cert_file = None
|
||||||
|
"""client certificate file
|
||||||
|
"""
|
||||||
|
self.key_file = None
|
||||||
|
"""client key file
|
||||||
|
"""
|
||||||
|
self.assert_hostname = None
|
||||||
|
"""Set this to True/False to enable/disable SSL hostname verification.
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
|
||||||
|
"""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.proxy = None
|
||||||
|
"""Proxy URL
|
||||||
|
"""
|
||||||
|
self.proxy_headers = None
|
||||||
|
"""Proxy headers
|
||||||
|
"""
|
||||||
|
self.safe_chars_for_path_param = ''
|
||||||
|
"""Safe chars for path_param
|
||||||
|
"""
|
||||||
|
self.retries = None
|
||||||
|
"""Adding retries to override urllib3 default value 3
|
||||||
|
"""
|
||||||
|
|
||||||
|
@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)
|
||||||
|
|
||||||
|
@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)
|
||||||
|
|
||||||
|
def get_host_settings(self):
|
||||||
|
"""Gets an array of host settings
|
||||||
|
|
||||||
|
:return: An array of host settings
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'url': "http://petstore.swagger.io:80/v2",
|
||||||
|
'description': "No description provided",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_host_from_settings(self, index, variables={}):
|
||||||
|
"""Gets host URL based on the index and variables
|
||||||
|
:param index: array index of the host settings
|
||||||
|
:param variables: hash of variable and the corresponding value
|
||||||
|
:return: URL based on host settings
|
||||||
|
"""
|
||||||
|
|
||||||
|
servers = self.get_host_settings()
|
||||||
|
|
||||||
|
# check array index out of bound
|
||||||
|
if index < 0 or index >= len(servers):
|
||||||
|
raise ValueError(
|
||||||
|
"Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501
|
||||||
|
.format(index, len(servers)))
|
||||||
|
|
||||||
|
server = servers[index]
|
||||||
|
url = server['url']
|
||||||
|
|
||||||
|
# go through variable and assign a value
|
||||||
|
for variable_name in server['variables']:
|
||||||
|
if variable_name in variables:
|
||||||
|
if variables[variable_name] in server['variables'][
|
||||||
|
variable_name]['enum_values']:
|
||||||
|
url = url.replace("{" + variable_name + "}",
|
||||||
|
variables[variable_name])
|
||||||
|
else:
|
||||||
|
raise ValueError(
|
||||||
|
"The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501
|
||||||
|
.format(
|
||||||
|
variable_name, variables[variable_name],
|
||||||
|
server['variables'][variable_name]['enum_values']))
|
||||||
|
else:
|
||||||
|
# use default value
|
||||||
|
url = url.replace(
|
||||||
|
"{" + variable_name + "}",
|
||||||
|
server['variables'][variable_name]['default_value'])
|
||||||
|
|
||||||
|
return url
|
@ -0,0 +1,120 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class OpenApiException(Exception):
|
||||||
|
"""The base exception class for all OpenAPIExceptions"""
|
||||||
|
|
||||||
|
|
||||||
|
class ApiTypeError(OpenApiException, TypeError):
|
||||||
|
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
||||||
|
key_type=None):
|
||||||
|
""" Raises an exception for TypeErrors
|
||||||
|
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (list): a list of keys an indices to get to the
|
||||||
|
current_item
|
||||||
|
None if unset
|
||||||
|
valid_classes (tuple): the primitive classes that current item
|
||||||
|
should be an instance of
|
||||||
|
None if unset
|
||||||
|
key_type (bool): False if our value is a value in a dict
|
||||||
|
True if it is a key in a dict
|
||||||
|
False if our item is an item in a list
|
||||||
|
None if unset
|
||||||
|
"""
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
self.valid_classes = valid_classes
|
||||||
|
self.key_type = key_type
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiTypeError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiValueError(OpenApiException, ValueError):
|
||||||
|
def __init__(self, msg, path_to_item=None):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (list) the path to the exception in the
|
||||||
|
received_data dict. None if unset
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiValueError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiKeyError(OpenApiException, KeyError):
|
||||||
|
def __init__(self, msg, path_to_item=None):
|
||||||
|
"""
|
||||||
|
Args:
|
||||||
|
msg (str): the exception message
|
||||||
|
|
||||||
|
Keyword Args:
|
||||||
|
path_to_item (None/list) the path to the exception in the
|
||||||
|
received_data dict
|
||||||
|
"""
|
||||||
|
self.path_to_item = path_to_item
|
||||||
|
full_msg = msg
|
||||||
|
if path_to_item:
|
||||||
|
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
||||||
|
super(ApiKeyError, self).__init__(full_msg)
|
||||||
|
|
||||||
|
|
||||||
|
class ApiException(OpenApiException):
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
def render_path(path_to_item):
|
||||||
|
"""Returns a string representation of a path"""
|
||||||
|
result = ""
|
||||||
|
for pth in path_to_item:
|
||||||
|
if isinstance(pth, six.integer_types):
|
||||||
|
result += "[{0}]".format(pth)
|
||||||
|
else:
|
||||||
|
result += "['{0}']".format(pth)
|
||||||
|
return result
|
@ -0,0 +1,62 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
# flake8: noqa
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
# import models into model package
|
||||||
|
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||||
|
from petstore_api.models.additional_properties_array import AdditionalPropertiesArray
|
||||||
|
from petstore_api.models.additional_properties_boolean import AdditionalPropertiesBoolean
|
||||||
|
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||||
|
from petstore_api.models.additional_properties_integer import AdditionalPropertiesInteger
|
||||||
|
from petstore_api.models.additional_properties_number import AdditionalPropertiesNumber
|
||||||
|
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||||
|
from petstore_api.models.additional_properties_string import AdditionalPropertiesString
|
||||||
|
from petstore_api.models.animal import Animal
|
||||||
|
from petstore_api.models.api_response import ApiResponse
|
||||||
|
from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
|
||||||
|
from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
|
||||||
|
from petstore_api.models.array_test import ArrayTest
|
||||||
|
from petstore_api.models.capitalization import Capitalization
|
||||||
|
from petstore_api.models.cat import Cat
|
||||||
|
from petstore_api.models.cat_all_of import CatAllOf
|
||||||
|
from petstore_api.models.category import Category
|
||||||
|
from petstore_api.models.class_model import ClassModel
|
||||||
|
from petstore_api.models.client import Client
|
||||||
|
from petstore_api.models.dog import Dog
|
||||||
|
from petstore_api.models.dog_all_of import DogAllOf
|
||||||
|
from petstore_api.models.enum_arrays import EnumArrays
|
||||||
|
from petstore_api.models.enum_class import EnumClass
|
||||||
|
from petstore_api.models.enum_test import EnumTest
|
||||||
|
from petstore_api.models.file import File
|
||||||
|
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
|
||||||
|
from petstore_api.models.format_test import FormatTest
|
||||||
|
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
|
||||||
|
from petstore_api.models.list import List
|
||||||
|
from petstore_api.models.map_test import MapTest
|
||||||
|
from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
from petstore_api.models.model200_response import Model200Response
|
||||||
|
from petstore_api.models.model_return import ModelReturn
|
||||||
|
from petstore_api.models.name import Name
|
||||||
|
from petstore_api.models.number_only import NumberOnly
|
||||||
|
from petstore_api.models.order import Order
|
||||||
|
from petstore_api.models.outer_composite import OuterComposite
|
||||||
|
from petstore_api.models.outer_enum import OuterEnum
|
||||||
|
from petstore_api.models.pet import Pet
|
||||||
|
from petstore_api.models.read_only_first import ReadOnlyFirst
|
||||||
|
from petstore_api.models.special_model_name import SpecialModelName
|
||||||
|
from petstore_api.models.tag import Tag
|
||||||
|
from petstore_api.models.type_holder_default import TypeHolderDefault
|
||||||
|
from petstore_api.models.type_holder_example import TypeHolderExample
|
||||||
|
from petstore_api.models.user import User
|
||||||
|
from petstore_api.models.xml_item import XmlItem
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesAnyType(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesAnyType. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesAnyType. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesAnyType.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesAnyType. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesAnyType):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesArray(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesArray. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesArray. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesArray.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesArray. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesArray):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesBoolean(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesBoolean. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesBoolean. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesBoolean.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesBoolean. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesBoolean):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,372 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesClass(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'map_string': 'dict(str, str)',
|
||||||
|
'map_number': 'dict(str, float)',
|
||||||
|
'map_integer': 'dict(str, int)',
|
||||||
|
'map_boolean': 'dict(str, bool)',
|
||||||
|
'map_array_integer': 'dict(str, list[int])',
|
||||||
|
'map_array_anytype': 'dict(str, list[object])',
|
||||||
|
'map_map_string': 'dict(str, dict(str, str))',
|
||||||
|
'map_map_anytype': 'dict(str, dict(str, object))',
|
||||||
|
'anytype_1': 'object',
|
||||||
|
'anytype_2': 'object',
|
||||||
|
'anytype_3': 'object'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'map_string': 'map_string',
|
||||||
|
'map_number': 'map_number',
|
||||||
|
'map_integer': 'map_integer',
|
||||||
|
'map_boolean': 'map_boolean',
|
||||||
|
'map_array_integer': 'map_array_integer',
|
||||||
|
'map_array_anytype': 'map_array_anytype',
|
||||||
|
'map_map_string': 'map_map_string',
|
||||||
|
'map_map_anytype': 'map_map_anytype',
|
||||||
|
'anytype_1': 'anytype_1',
|
||||||
|
'anytype_2': 'anytype_2',
|
||||||
|
'anytype_3': 'anytype_3'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._map_string = None
|
||||||
|
self._map_number = None
|
||||||
|
self._map_integer = None
|
||||||
|
self._map_boolean = None
|
||||||
|
self._map_array_integer = None
|
||||||
|
self._map_array_anytype = None
|
||||||
|
self._map_map_string = None
|
||||||
|
self._map_map_anytype = None
|
||||||
|
self._anytype_1 = None
|
||||||
|
self._anytype_2 = None
|
||||||
|
self._anytype_3 = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if map_string is not None:
|
||||||
|
self.map_string = map_string
|
||||||
|
if map_number is not None:
|
||||||
|
self.map_number = map_number
|
||||||
|
if map_integer is not None:
|
||||||
|
self.map_integer = map_integer
|
||||||
|
if map_boolean is not None:
|
||||||
|
self.map_boolean = map_boolean
|
||||||
|
if map_array_integer is not None:
|
||||||
|
self.map_array_integer = map_array_integer
|
||||||
|
if map_array_anytype is not None:
|
||||||
|
self.map_array_anytype = map_array_anytype
|
||||||
|
if map_map_string is not None:
|
||||||
|
self.map_map_string = map_map_string
|
||||||
|
if map_map_anytype is not None:
|
||||||
|
self.map_map_anytype = map_map_anytype
|
||||||
|
if anytype_1 is not None:
|
||||||
|
self.anytype_1 = anytype_1
|
||||||
|
if anytype_2 is not None:
|
||||||
|
self.anytype_2 = anytype_2
|
||||||
|
if anytype_3 is not None:
|
||||||
|
self.anytype_3 = anytype_3
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_string(self):
|
||||||
|
"""Gets the map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, str)
|
||||||
|
"""
|
||||||
|
return self._map_string
|
||||||
|
|
||||||
|
@map_string.setter
|
||||||
|
def map_string(self, map_string):
|
||||||
|
"""Sets the map_string of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, str)
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_string = map_string
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_number(self):
|
||||||
|
"""Gets the map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, float)
|
||||||
|
"""
|
||||||
|
return self._map_number
|
||||||
|
|
||||||
|
@map_number.setter
|
||||||
|
def map_number(self, map_number):
|
||||||
|
"""Sets the map_number of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, float)
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_number = map_number
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_integer(self):
|
||||||
|
"""Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, int)
|
||||||
|
"""
|
||||||
|
return self._map_integer
|
||||||
|
|
||||||
|
@map_integer.setter
|
||||||
|
def map_integer(self, map_integer):
|
||||||
|
"""Sets the map_integer of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, int)
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_integer = map_integer
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_boolean(self):
|
||||||
|
"""Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, bool)
|
||||||
|
"""
|
||||||
|
return self._map_boolean
|
||||||
|
|
||||||
|
@map_boolean.setter
|
||||||
|
def map_boolean(self, map_boolean):
|
||||||
|
"""Sets the map_boolean of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, bool)
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_boolean = map_boolean
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_array_integer(self):
|
||||||
|
"""Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, list[int])
|
||||||
|
"""
|
||||||
|
return self._map_array_integer
|
||||||
|
|
||||||
|
@map_array_integer.setter
|
||||||
|
def map_array_integer(self, map_array_integer):
|
||||||
|
"""Sets the map_array_integer of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, list[int])
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_array_integer = map_array_integer
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_array_anytype(self):
|
||||||
|
"""Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, list[object])
|
||||||
|
"""
|
||||||
|
return self._map_array_anytype
|
||||||
|
|
||||||
|
@map_array_anytype.setter
|
||||||
|
def map_array_anytype(self, map_array_anytype):
|
||||||
|
"""Sets the map_array_anytype of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, list[object])
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_array_anytype = map_array_anytype
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_map_string(self):
|
||||||
|
"""Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, dict(str, str))
|
||||||
|
"""
|
||||||
|
return self._map_map_string
|
||||||
|
|
||||||
|
@map_map_string.setter
|
||||||
|
def map_map_string(self, map_map_string):
|
||||||
|
"""Sets the map_map_string of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, dict(str, str))
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_map_string = map_map_string
|
||||||
|
|
||||||
|
@property
|
||||||
|
def map_map_anytype(self):
|
||||||
|
"""Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: dict(str, dict(str, object))
|
||||||
|
"""
|
||||||
|
return self._map_map_anytype
|
||||||
|
|
||||||
|
@map_map_anytype.setter
|
||||||
|
def map_map_anytype(self, map_map_anytype):
|
||||||
|
"""Sets the map_map_anytype of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: dict(str, dict(str, object))
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._map_map_anytype = map_map_anytype
|
||||||
|
|
||||||
|
@property
|
||||||
|
def anytype_1(self):
|
||||||
|
"""Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: object
|
||||||
|
"""
|
||||||
|
return self._anytype_1
|
||||||
|
|
||||||
|
@anytype_1.setter
|
||||||
|
def anytype_1(self, anytype_1):
|
||||||
|
"""Sets the anytype_1 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: object
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._anytype_1 = anytype_1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def anytype_2(self):
|
||||||
|
"""Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: object
|
||||||
|
"""
|
||||||
|
return self._anytype_2
|
||||||
|
|
||||||
|
@anytype_2.setter
|
||||||
|
def anytype_2(self, anytype_2):
|
||||||
|
"""Sets the anytype_2 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: object
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._anytype_2 = anytype_2
|
||||||
|
|
||||||
|
@property
|
||||||
|
def anytype_3(self):
|
||||||
|
"""Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:rtype: object
|
||||||
|
"""
|
||||||
|
return self._anytype_3
|
||||||
|
|
||||||
|
@anytype_3.setter
|
||||||
|
def anytype_3(self, anytype_3):
|
||||||
|
"""Sets the anytype_3 of this AdditionalPropertiesClass.
|
||||||
|
|
||||||
|
|
||||||
|
:param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501
|
||||||
|
:type: object
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._anytype_3 = anytype_3
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Returns the model properties as a dict"""
|
||||||
|
result = {}
|
||||||
|
|
||||||
|
for attr, _ in six.iteritems(self.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesInteger(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesInteger. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesInteger. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesInteger.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesInteger. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesInteger):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesNumber(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesNumber. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesNumber. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesNumber.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesNumber. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesNumber):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesObject(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesObject. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesObject. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesObject.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesObject. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesObject):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class AdditionalPropertiesString(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, name=None): # noqa: E501
|
||||||
|
"""AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if name is not None:
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self):
|
||||||
|
"""Gets the name of this AdditionalPropertiesString. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this AdditionalPropertiesString. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._name
|
||||||
|
|
||||||
|
@name.setter
|
||||||
|
def name(self, name):
|
||||||
|
"""Sets the name of this AdditionalPropertiesString.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this AdditionalPropertiesString. # 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.openapi_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
|
||||||
|
|
||||||
|
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, AdditionalPropertiesString):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,150 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Animal(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'class_name': 'str',
|
||||||
|
'color': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'class_name': 'className',
|
||||||
|
'color': 'color'
|
||||||
|
}
|
||||||
|
|
||||||
|
discriminator_value_class_map = {
|
||||||
|
'Dog': 'Dog',
|
||||||
|
'Cat': 'Cat'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, class_name=None, color='red'): # noqa: E501
|
||||||
|
"""Animal - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._class_name = None
|
||||||
|
self._color = None
|
||||||
|
self.discriminator = 'class_name'
|
||||||
|
|
||||||
|
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_key = self.attribute_map[self.discriminator]
|
||||||
|
discriminator_value = data[discriminator_key]
|
||||||
|
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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,164 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class ApiResponse(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_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 OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class ArrayOfArrayOfNumberOnly(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_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 OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class ArrayOfNumberOnly(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'array_number': 'list[float]'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'array_number': 'ArrayNumber'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, array_number=None): # noqa: E501
|
||||||
|
"""ArrayOfNumberOnly - a model defined in OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,164 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class ArrayTest(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_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 OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,244 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Capitalization(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_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 OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Cat(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'declawed': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'declawed': 'declawed'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, declawed=None): # noqa: E501
|
||||||
|
"""Cat - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._declawed = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if declawed is not None:
|
||||||
|
self.declawed = declawed
|
||||||
|
|
||||||
|
@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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class CatAllOf(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'declawed': 'bool'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'declawed': 'declawed'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, declawed=None): # noqa: E501
|
||||||
|
"""CatAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._declawed = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if declawed is not None:
|
||||||
|
self.declawed = declawed
|
||||||
|
|
||||||
|
@property
|
||||||
|
def declawed(self):
|
||||||
|
"""Gets the declawed of this CatAllOf. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The declawed of this CatAllOf. # noqa: E501
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
|
return self._declawed
|
||||||
|
|
||||||
|
@declawed.setter
|
||||||
|
def declawed(self, declawed):
|
||||||
|
"""Sets the declawed of this CatAllOf.
|
||||||
|
|
||||||
|
|
||||||
|
:param declawed: The declawed of this CatAllOf. # 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.openapi_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
|
||||||
|
|
||||||
|
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, CatAllOf):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
@ -0,0 +1,139 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Category(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'id': 'int',
|
||||||
|
'name': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'id': 'id',
|
||||||
|
'name': 'name'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, id=None, name='default-name'): # noqa: E501
|
||||||
|
"""Category - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._id = None
|
||||||
|
self._name = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if id is not None:
|
||||||
|
self.id = id
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
if name is None:
|
||||||
|
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
|
||||||
|
|
||||||
|
self._name = name
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
"""Returns the model properties as a dict"""
|
||||||
|
result = {}
|
||||||
|
|
||||||
|
for attr, _ in six.iteritems(self.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class ClassModel(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'_class': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'_class': '_class'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, _class=None): # noqa: E501
|
||||||
|
"""ClassModel - a model defined in OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Client(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'client': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'client': 'client'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, client=None): # noqa: E501
|
||||||
|
"""Client - a model defined in OpenAPI""" # 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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class Dog(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'breed': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'breed': 'breed'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, breed=None): # noqa: E501
|
||||||
|
"""Dog - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._breed = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if breed is not None:
|
||||||
|
self.breed = breed
|
||||||
|
|
||||||
|
@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.openapi_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
|
||||||
|
|
||||||
|
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
|
@ -0,0 +1,112 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
"""
|
||||||
|
OpenAPI 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
|
||||||
|
|
||||||
|
The version of the OpenAPI document: 1.0.0
|
||||||
|
Generated by: https://openapi-generator.tech
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import pprint
|
||||||
|
import re # noqa: F401
|
||||||
|
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
|
class DogAllOf(object):
|
||||||
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
|
Do not edit the class manually.
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
Attributes:
|
||||||
|
openapi_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.
|
||||||
|
"""
|
||||||
|
openapi_types = {
|
||||||
|
'breed': 'str'
|
||||||
|
}
|
||||||
|
|
||||||
|
attribute_map = {
|
||||||
|
'breed': 'breed'
|
||||||
|
}
|
||||||
|
|
||||||
|
def __init__(self, breed=None): # noqa: E501
|
||||||
|
"""DogAllOf - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
|
self._breed = None
|
||||||
|
self.discriminator = None
|
||||||
|
|
||||||
|
if breed is not None:
|
||||||
|
self.breed = breed
|
||||||
|
|
||||||
|
@property
|
||||||
|
def breed(self):
|
||||||
|
"""Gets the breed of this DogAllOf. # noqa: E501
|
||||||
|
|
||||||
|
|
||||||
|
:return: The breed of this DogAllOf. # noqa: E501
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._breed
|
||||||
|
|
||||||
|
@breed.setter
|
||||||
|
def breed(self, breed):
|
||||||
|
"""Sets the breed of this DogAllOf.
|
||||||
|
|
||||||
|
|
||||||
|
:param breed: The breed of this DogAllOf. # 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.openapi_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
|
||||||
|
|
||||||
|
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, DogAllOf):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return self.__dict__ == other.__dict__
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
"""Returns true if both objects are not equal"""
|
||||||
|
return not self == other
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user