Add python-experimental-openapiv3-sample (#4992)

Add python-experimental-openapiv3-sample

Add missing files for the Python samples

Add python-experimental-petstore.bat for openapi v3

Add python-experimental samples openapi v3

Add python-experimental samples openapi v3

Add python-experimental samples openapi v3. Address review comments

add missing files for test purpose

fix python formatting issues

fix python formatting issues

fix python formatting issues

Fix unit tests

fix python formatting issues

fix python formatting issues

fix python formatting issues

fix 'line too long' pep8 error

address PR comments for pep8 'line too long' problem

regenerate samples

execute samples scripts

dummy commit to retrigger circleci

Revert dummy commit, it didn't help.
This commit is contained in:
Sebastien Rosset 2020-01-21 07:19:07 -08:00 committed by William Cheng
parent 95bd32d474
commit 63859d6d51
226 changed files with 22417 additions and 214 deletions

View 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 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/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@"
java $JAVA_OPTS -jar $executable $ags

View File

@ -0,0 +1,10 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -41,6 +41,7 @@ declare -a samples=(
"${root}/bin/python-petstore-all.sh" "${root}/bin/python-petstore-all.sh"
"${root}/bin/python-server-all.sh" "${root}/bin/python-server-all.sh"
"${root}/bin/openapi3/python-petstore.sh" "${root}/bin/openapi3/python-petstore.sh"
"${root}/bin/openapi3/python-experimental-petstore.sh"
"${root}/bin/php-petstore.sh" "${root}/bin/php-petstore.sh"
"${root}/bin/php-silex-petstore-server.sh" "${root}/bin/php-silex-petstore-server.sh"
"${root}/bin/php-symfony-petstore.sh" "${root}/bin/php-symfony-petstore.sh"

View File

@ -277,7 +277,9 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen {
// name looks like cat.Cat // name looks like cat.Cat
String moduleName = name.split("\\.")[0]; String moduleName = name.split("\\.")[0];
// https://exceptionshub.com/circular-or-cyclic-imports-in-python.html // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html
String modelImport = "try:\n from " + modelPackage() + " import "+ moduleName+ "\nexcept ImportError:\n "+moduleName+" = sys.modules['"+modelPackage() + "."+ moduleName+"']"; String modelImport = "try:\n from " + modelPackage() +
" import " + moduleName+ "\nexcept ImportError:\n " +
moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']";
return modelImport; return modelImport;
} }

View File

@ -108,7 +108,8 @@ class {{classname}}(object):
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
{{#requiredParams}} {{#requiredParams}}
kwargs['{{paramName}}'] = {{paramName}} kwargs['{{paramName}}'] = \
{{paramName}}
{{/requiredParams}} {{/requiredParams}}
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
@ -216,7 +217,8 @@ class {{classname}}(object):
}, },
'openapi_types': { 'openapi_types': {
{{#allParams}} {{#allParams}}
'{{paramName}}': ({{{dataType}}},), '{{paramName}}':
({{{dataType}}},),
{{/allParams}} {{/allParams}}
}, },
'attribute_map': { 'attribute_map': {

View File

@ -1060,6 +1060,7 @@
<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>
<module>samples/openapi3/client/petstore/python-experimental</module>
<module>samples/client/petstore/typescript-fetch/builds/default</module> <module>samples/client/petstore/typescript-fetch/builds/default</module>
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module> <module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
<module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module> <module>samples/client/petstore/typescript-fetch/builds/with-npm-version</module>

View File

@ -102,7 +102,8 @@ class AnotherFakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.call_123_test_special_tags = Endpoint( self.call_123_test_special_tags = Endpoint(
@ -134,7 +135,8 @@ class AnotherFakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (client.Client,), 'body':
(client.Client,),
}, },
'attribute_map': { 'attribute_map': {
}, },

View File

@ -108,7 +108,8 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['xml_item'] = xml_item kwargs['xml_item'] = \
xml_item
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.create_xml_item = Endpoint( self.create_xml_item = Endpoint(
@ -140,7 +141,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'xml_item': (xml_item.XmlItem,), 'xml_item':
(xml_item.XmlItem,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -247,7 +249,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (bool,), 'body':
(bool,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -349,7 +352,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (outer_composite.OuterComposite,), 'body':
(outer_composite.OuterComposite,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -451,7 +455,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (outer_enum.OuterEnum,), 'body':
(outer_enum.OuterEnum,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -553,7 +558,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (outer_number.OuterNumber,), 'body':
(outer_number.OuterNumber,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -655,7 +661,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (str,), 'body':
(str,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -728,7 +735,8 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_body_with_file_schema = Endpoint( self.test_body_with_file_schema = Endpoint(
@ -760,7 +768,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (file_schema_test_class.FileSchemaTestClass,), 'body':
(file_schema_test_class.FileSchemaTestClass,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -833,8 +842,10 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['query'] = query kwargs['query'] = \
kwargs['body'] = body query
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_body_with_query_params = Endpoint( self.test_body_with_query_params = Endpoint(
@ -868,8 +879,10 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'query': (str,), 'query':
'body': (user.User,), (str,),
'body':
(user.User,),
}, },
'attribute_map': { 'attribute_map': {
'query': 'query', 'query': 'query',
@ -944,7 +957,8 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_client_model = Endpoint( self.test_client_model = Endpoint(
@ -976,7 +990,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (client.Client,), 'body':
(client.Client,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -1055,11 +1070,16 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['query_integer'] = query_integer kwargs['query_integer'] = \
kwargs['query_string'] = query_string query_integer
kwargs['path_string'] = path_string kwargs['query_string'] = \
kwargs['path_integer'] = path_integer query_string
kwargs['header_number'] = header_number kwargs['path_string'] = \
path_string
kwargs['path_integer'] = \
path_integer
kwargs['header_number'] = \
header_number
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_endpoint_enums_length_one = Endpoint( self.test_endpoint_enums_length_one = Endpoint(
@ -1124,11 +1144,16 @@ class FakeApi(object):
}, },
}, },
'openapi_types': { 'openapi_types': {
'query_integer': (int,), 'query_integer':
'query_string': (str,), (int,),
'path_string': (str,), 'query_string':
'path_integer': (int,), (str,),
'header_number': (float,), 'path_string':
(str,),
'path_integer':
(int,),
'header_number':
(float,),
}, },
'attribute_map': { 'attribute_map': {
'query_integer': 'query_integer', 'query_integer': 'query_integer',
@ -1221,10 +1246,14 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['number'] = number kwargs['number'] = \
kwargs['double'] = double number
kwargs['pattern_without_delimiter'] = pattern_without_delimiter kwargs['double'] = \
kwargs['byte'] = byte double
kwargs['pattern_without_delimiter'] = \
pattern_without_delimiter
kwargs['byte'] = \
byte
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_endpoint_parameters = Endpoint( self.test_endpoint_parameters = Endpoint(
@ -1323,20 +1352,34 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'number': (float,), 'number':
'double': (float,), (float,),
'pattern_without_delimiter': (str,), 'double':
'byte': (str,), (float,),
'integer': (int,), 'pattern_without_delimiter':
'int32': (int,), (str,),
'int64': (int,), 'byte':
'float': (float,), (str,),
'string': (str,), 'integer':
'binary': (file_type,), (int,),
'date': (date,), 'int32':
'date_time': (datetime,), (int,),
'password': (str,), 'int64':
'param_callback': (str,), (int,),
'float':
(float,),
'string':
(str,),
'binary':
(file_type,),
'date':
(date,),
'date_time':
(datetime,),
'password':
(str,),
'param_callback':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'number': 'number', 'number': 'number',
@ -1530,14 +1573,22 @@ class FakeApi(object):
}, },
}, },
'openapi_types': { 'openapi_types': {
'enum_header_string_array': ([str],), 'enum_header_string_array':
'enum_header_string': (str,), ([str],),
'enum_query_string_array': ([str],), 'enum_header_string':
'enum_query_string': (str,), (str,),
'enum_query_integer': (int,), 'enum_query_string_array':
'enum_query_double': (float,), ([str],),
'enum_form_string_array': ([str],), 'enum_query_string':
'enum_form_string': (str,), (str,),
'enum_query_integer':
(int,),
'enum_query_double':
(float,),
'enum_form_string_array':
([str],),
'enum_form_string':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'enum_header_string_array': 'enum_header_string_array', 'enum_header_string_array': 'enum_header_string_array',
@ -1633,9 +1684,12 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['required_string_group'] = required_string_group kwargs['required_string_group'] = \
kwargs['required_boolean_group'] = required_boolean_group required_string_group
kwargs['required_int64_group'] = required_int64_group kwargs['required_boolean_group'] = \
required_boolean_group
kwargs['required_int64_group'] = \
required_int64_group
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_group_parameters = Endpoint( self.test_group_parameters = Endpoint(
@ -1674,12 +1728,18 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'required_string_group': (int,), 'required_string_group':
'required_boolean_group': (bool,), (int,),
'required_int64_group': (int,), 'required_boolean_group':
'string_group': (int,), (bool,),
'boolean_group': (bool,), 'required_int64_group':
'int64_group': (int,), (int,),
'string_group':
(int,),
'boolean_group':
(bool,),
'int64_group':
(int,),
}, },
'attribute_map': { 'attribute_map': {
'required_string_group': 'required_string_group', 'required_string_group': 'required_string_group',
@ -1760,7 +1820,8 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['param'] = param kwargs['param'] = \
param
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_inline_additional_properties = Endpoint( self.test_inline_additional_properties = Endpoint(
@ -1792,7 +1853,8 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'param': ({str: (str,)},), 'param':
({str: (str,)},),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -1865,8 +1927,10 @@ class FakeApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['param'] = param kwargs['param'] = \
kwargs['param2'] = param2 param
kwargs['param2'] = \
param2
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_json_form_data = Endpoint( self.test_json_form_data = Endpoint(
@ -1900,8 +1964,10 @@ class FakeApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'param': (str,), 'param':
'param2': (str,), (str,),
'param2':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'param': 'param', 'param': 'param',

View File

@ -102,7 +102,8 @@ class FakeClassnameTags123Api(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.test_classname = Endpoint( self.test_classname = Endpoint(
@ -136,7 +137,8 @@ class FakeClassnameTags123Api(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (client.Client,), 'body':
(client.Client,),
}, },
'attribute_map': { 'attribute_map': {
}, },

View File

@ -102,7 +102,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.add_pet = Endpoint( self.add_pet = Endpoint(
@ -136,7 +137,8 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (pet.Pet,), 'body':
(pet.Pet,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -210,7 +212,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id kwargs['pet_id'] = \
pet_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.delete_pet = Endpoint( self.delete_pet = Endpoint(
@ -245,8 +248,10 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'pet_id': (int,), 'pet_id':
'api_key': (str,), (int,),
'api_key':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'pet_id': 'petId', 'pet_id': 'petId',
@ -320,7 +325,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['status'] = status kwargs['status'] = \
status
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.find_pets_by_status = Endpoint( self.find_pets_by_status = Endpoint(
@ -361,7 +367,8 @@ class PetApi(object):
}, },
}, },
'openapi_types': { 'openapi_types': {
'status': ([str],), 'status':
([str],),
}, },
'attribute_map': { 'attribute_map': {
'status': 'status', 'status': 'status',
@ -437,7 +444,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['tags'] = tags kwargs['tags'] = \
tags
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.find_pets_by_tags = Endpoint( self.find_pets_by_tags = Endpoint(
@ -471,7 +479,8 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'tags': ([str],), 'tags':
([str],),
}, },
'attribute_map': { 'attribute_map': {
'tags': 'tags', 'tags': 'tags',
@ -547,7 +556,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id kwargs['pet_id'] = \
pet_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.get_pet_by_id = Endpoint( self.get_pet_by_id = Endpoint(
@ -581,7 +591,8 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'pet_id': (int,), 'pet_id':
(int,),
}, },
'attribute_map': { 'attribute_map': {
'pet_id': 'petId', 'pet_id': 'petId',
@ -655,7 +666,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.update_pet = Endpoint( self.update_pet = Endpoint(
@ -689,7 +701,8 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (pet.Pet,), 'body':
(pet.Pet,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -764,7 +777,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id kwargs['pet_id'] = \
pet_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.update_pet_with_form = Endpoint( self.update_pet_with_form = Endpoint(
@ -800,9 +814,12 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'pet_id': (int,), 'pet_id':
'name': (str,), (int,),
'status': (str,), 'name':
(str,),
'status':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'pet_id': 'petId', 'pet_id': 'petId',
@ -882,7 +899,8 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id kwargs['pet_id'] = \
pet_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.upload_file = Endpoint( self.upload_file = Endpoint(
@ -919,10 +937,14 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'pet_id': (int,), 'pet_id':
'additional_metadata': (str,), (int,),
'file': (file_type,), 'additional_metadata':
'files': ([file_type],), (str,),
'file':
(file_type,),
'files':
([file_type],),
}, },
'attribute_map': { 'attribute_map': {
'pet_id': 'petId', 'pet_id': 'petId',
@ -1006,8 +1028,10 @@ class PetApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id kwargs['pet_id'] = \
kwargs['required_file'] = required_file pet_id
kwargs['required_file'] = \
required_file
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.upload_file_with_required_file = Endpoint( self.upload_file_with_required_file = Endpoint(
@ -1044,9 +1068,12 @@ class PetApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'pet_id': (int,), 'pet_id':
'required_file': (file_type,), (int,),
'additional_metadata': (str,), 'required_file':
(file_type,),
'additional_metadata':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'pet_id': 'petId', 'pet_id': 'petId',

View File

@ -102,7 +102,8 @@ class StoreApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['order_id'] = order_id kwargs['order_id'] = \
order_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.delete_order = Endpoint( self.delete_order = Endpoint(
@ -134,7 +135,8 @@ class StoreApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'order_id': (str,), 'order_id':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'order_id': 'order_id', 'order_id': 'order_id',
@ -306,7 +308,8 @@ class StoreApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['order_id'] = order_id kwargs['order_id'] = \
order_id
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.get_order_by_id = Endpoint( self.get_order_by_id = Endpoint(
@ -344,7 +347,8 @@ class StoreApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'order_id': (int,), 'order_id':
(int,),
}, },
'attribute_map': { 'attribute_map': {
'order_id': 'order_id', 'order_id': 'order_id',
@ -418,7 +422,8 @@ class StoreApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.place_order = Endpoint( self.place_order = Endpoint(
@ -450,7 +455,8 @@ class StoreApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (order.Order,), 'body':
(order.Order,),
}, },
'attribute_map': { 'attribute_map': {
}, },

View File

@ -102,7 +102,8 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.create_user = Endpoint( self.create_user = Endpoint(
@ -134,7 +135,8 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': (user.User,), 'body':
(user.User,),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -204,7 +206,8 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.create_users_with_array_input = Endpoint( self.create_users_with_array_input = Endpoint(
@ -236,7 +239,8 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': ([user.User],), 'body':
([user.User],),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -306,7 +310,8 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.create_users_with_list_input = Endpoint( self.create_users_with_list_input = Endpoint(
@ -338,7 +343,8 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'body': ([user.User],), 'body':
([user.User],),
}, },
'attribute_map': { 'attribute_map': {
}, },
@ -409,7 +415,8 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username kwargs['username'] = \
username
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.delete_user = Endpoint( self.delete_user = Endpoint(
@ -441,7 +448,8 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'username': (str,), 'username':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'username': 'username', 'username': 'username',
@ -512,7 +520,8 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username kwargs['username'] = \
username
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.get_user_by_name = Endpoint( self.get_user_by_name = Endpoint(
@ -544,7 +553,8 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'username': (str,), 'username':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'username': 'username', 'username': 'username',
@ -619,8 +629,10 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username kwargs['username'] = \
kwargs['password'] = password username
kwargs['password'] = \
password
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.login_user = Endpoint( self.login_user = Endpoint(
@ -654,8 +666,10 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'username': (str,), 'username':
'password': (str,), (str,),
'password':
(str,),
}, },
'attribute_map': { 'attribute_map': {
'username': 'username', 'username': 'username',
@ -828,8 +842,10 @@ class UserApi(object):
'_check_return_type', True '_check_return_type', True
) )
kwargs['_host_index'] = kwargs.get('_host_index', 0) kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username kwargs['username'] = \
kwargs['body'] = body username
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs) return self.call_with_http_info(**kwargs)
self.update_user = Endpoint( self.update_user = Endpoint(
@ -863,8 +879,10 @@ class UserApi(object):
'allowed_values': { 'allowed_values': {
}, },
'openapi_types': { 'openapi_types': {
'username': (str,), 'username':
'body': (user.User,), (str,),
'body':
(user.User,),
}, },
'attribute_map': { 'attribute_map': {
'username': 'username', 'username': 'username',

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import cat from petstore_api.models import cat
except ImportError: except ImportError:
cat = sys.modules['petstore_api.models.cat'] cat = sys.modules[
'petstore_api.models.cat']
try: try:
from petstore_api.models import dog from petstore_api.models import dog
except ImportError: except ImportError:
dog = sys.modules['petstore_api.models.dog'] dog = sys.modules[
'petstore_api.models.dog']
class Animal(ModelNormal): class Animal(ModelNormal):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import read_only_first from petstore_api.models import read_only_first
except ImportError: except ImportError:
read_only_first = sys.modules['petstore_api.models.read_only_first'] read_only_first = sys.modules[
'petstore_api.models.read_only_first']
class ArrayTest(ModelNormal): class ArrayTest(ModelNormal):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import animal from petstore_api.models import animal
except ImportError: except ImportError:
animal = sys.modules['petstore_api.models.animal'] animal = sys.modules[
'petstore_api.models.animal']
try: try:
from petstore_api.models import cat_all_of from petstore_api.models import cat_all_of
except ImportError: except ImportError:
cat_all_of = sys.modules['petstore_api.models.cat_all_of'] cat_all_of = sys.modules[
'petstore_api.models.cat_all_of']
class Cat(ModelComposed): class Cat(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import child_all_of from petstore_api.models import child_all_of
except ImportError: except ImportError:
child_all_of = sys.modules['petstore_api.models.child_all_of'] child_all_of = sys.modules[
'petstore_api.models.child_all_of']
try: try:
from petstore_api.models import parent from petstore_api.models import parent
except ImportError: except ImportError:
parent = sys.modules['petstore_api.models.parent'] parent = sys.modules[
'petstore_api.models.parent']
class Child(ModelComposed): class Child(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import child_cat_all_of from petstore_api.models import child_cat_all_of
except ImportError: except ImportError:
child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] child_cat_all_of = sys.modules[
'petstore_api.models.child_cat_all_of']
try: try:
from petstore_api.models import parent_pet from petstore_api.models import parent_pet
except ImportError: except ImportError:
parent_pet = sys.modules['petstore_api.models.parent_pet'] parent_pet = sys.modules[
'petstore_api.models.parent_pet']
class ChildCat(ModelComposed): class ChildCat(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import child_dog_all_of from petstore_api.models import child_dog_all_of
except ImportError: except ImportError:
child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] child_dog_all_of = sys.modules[
'petstore_api.models.child_dog_all_of']
try: try:
from petstore_api.models import parent_pet from petstore_api.models import parent_pet
except ImportError: except ImportError:
parent_pet = sys.modules['petstore_api.models.parent_pet'] parent_pet = sys.modules[
'petstore_api.models.parent_pet']
class ChildDog(ModelComposed): class ChildDog(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import child_lizard_all_of from petstore_api.models import child_lizard_all_of
except ImportError: except ImportError:
child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] child_lizard_all_of = sys.modules[
'petstore_api.models.child_lizard_all_of']
try: try:
from petstore_api.models import parent_pet from petstore_api.models import parent_pet
except ImportError: except ImportError:
parent_pet = sys.modules['petstore_api.models.parent_pet'] parent_pet = sys.modules[
'petstore_api.models.parent_pet']
class ChildLizard(ModelComposed): class ChildLizard(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import animal from petstore_api.models import animal
except ImportError: except ImportError:
animal = sys.modules['petstore_api.models.animal'] animal = sys.modules[
'petstore_api.models.animal']
try: try:
from petstore_api.models import dog_all_of from petstore_api.models import dog_all_of
except ImportError: except ImportError:
dog_all_of = sys.modules['petstore_api.models.dog_all_of'] dog_all_of = sys.modules[
'petstore_api.models.dog_all_of']
class Dog(ModelComposed): class Dog(ModelComposed):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import outer_enum from petstore_api.models import outer_enum
except ImportError: except ImportError:
outer_enum = sys.modules['petstore_api.models.outer_enum'] outer_enum = sys.modules[
'petstore_api.models.outer_enum']
class EnumTest(ModelNormal): class EnumTest(ModelNormal):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import file from petstore_api.models import file
except ImportError: except ImportError:
file = sys.modules['petstore_api.models.file'] file = sys.modules[
'petstore_api.models.file']
class FileSchemaTestClass(ModelNormal): class FileSchemaTestClass(ModelNormal):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import string_boolean_map from petstore_api.models import string_boolean_map
except ImportError: except ImportError:
string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] string_boolean_map = sys.modules[
'petstore_api.models.string_boolean_map']
class MapTest(ModelNormal): class MapTest(ModelNormal):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import animal from petstore_api.models import animal
except ImportError: except ImportError:
animal = sys.modules['petstore_api.models.animal'] animal = sys.modules[
'petstore_api.models.animal']
class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal):

View File

@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import outer_number from petstore_api.models import outer_number
except ImportError: except ImportError:
outer_number = sys.modules['petstore_api.models.outer_number'] outer_number = sys.modules[
'petstore_api.models.outer_number']
class OuterComposite(ModelNormal): class OuterComposite(ModelNormal):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import grandparent from petstore_api.models import grandparent
except ImportError: except ImportError:
grandparent = sys.modules['petstore_api.models.grandparent'] grandparent = sys.modules[
'petstore_api.models.grandparent']
try: try:
from petstore_api.models import parent_all_of from petstore_api.models import parent_all_of
except ImportError: except ImportError:
parent_all_of = sys.modules['petstore_api.models.parent_all_of'] parent_all_of = sys.modules[
'petstore_api.models.parent_all_of']
class Parent(ModelComposed): class Parent(ModelComposed):

View File

@ -31,19 +31,23 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import child_cat from petstore_api.models import child_cat
except ImportError: except ImportError:
child_cat = sys.modules['petstore_api.models.child_cat'] child_cat = sys.modules[
'petstore_api.models.child_cat']
try: try:
from petstore_api.models import child_dog from petstore_api.models import child_dog
except ImportError: except ImportError:
child_dog = sys.modules['petstore_api.models.child_dog'] child_dog = sys.modules[
'petstore_api.models.child_dog']
try: try:
from petstore_api.models import child_lizard from petstore_api.models import child_lizard
except ImportError: except ImportError:
child_lizard = sys.modules['petstore_api.models.child_lizard'] child_lizard = sys.modules[
'petstore_api.models.child_lizard']
try: try:
from petstore_api.models import grandparent_animal from petstore_api.models import grandparent_animal
except ImportError: except ImportError:
grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] grandparent_animal = sys.modules[
'petstore_api.models.grandparent_animal']
class ParentPet(ModelComposed): class ParentPet(ModelComposed):

View File

@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try: try:
from petstore_api.models import category from petstore_api.models import category
except ImportError: except ImportError:
category = sys.modules['petstore_api.models.category'] category = sys.modules[
'petstore_api.models.category']
try: try:
from petstore_api.models import tag from petstore_api.models import tag
except ImportError: except ImportError:
tag = sys.modules['petstore_api.models.tag'] tag = sys.modules[
'petstore_api.models.tag']
class Pet(ModelNormal): class Pet(ModelNormal):

View File

@ -0,0 +1,66 @@
# 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/
.venv/
.python-version
.pytest_cache
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints

View File

@ -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

View File

@ -0,0 +1 @@
4.2.3-SNAPSHOT

View File

@ -0,0 +1,15 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: nosetests

View File

@ -0,0 +1,19 @@
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

View File

@ -0,0 +1,210 @@
# 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 a repository, you can install directly using:
```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 pprint import pprint
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration))
client_client = petstore_api.Client() # client.Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client_client)
pprint(api_response)
except petstore_api.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
*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
*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 \&quot;client\&quot; 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
*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
*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
- [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [animal.Animal](docs/Animal.md)
- [api_response.ApiResponse](docs/ApiResponse.md)
- [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [array_test.ArrayTest](docs/ArrayTest.md)
- [capitalization.Capitalization](docs/Capitalization.md)
- [cat.Cat](docs/Cat.md)
- [cat_all_of.CatAllOf](docs/CatAllOf.md)
- [category.Category](docs/Category.md)
- [class_model.ClassModel](docs/ClassModel.md)
- [client.Client](docs/Client.md)
- [dog.Dog](docs/Dog.md)
- [dog_all_of.DogAllOf](docs/DogAllOf.md)
- [enum_arrays.EnumArrays](docs/EnumArrays.md)
- [enum_class.EnumClass](docs/EnumClass.md)
- [enum_test.EnumTest](docs/EnumTest.md)
- [file.File](docs/File.md)
- [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [foo.Foo](docs/Foo.md)
- [format_test.FormatTest](docs/FormatTest.md)
- [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [health_check_result.HealthCheckResult](docs/HealthCheckResult.md)
- [inline_object.InlineObject](docs/InlineObject.md)
- [inline_object1.InlineObject1](docs/InlineObject1.md)
- [inline_object2.InlineObject2](docs/InlineObject2.md)
- [inline_object3.InlineObject3](docs/InlineObject3.md)
- [inline_object4.InlineObject4](docs/InlineObject4.md)
- [inline_object5.InlineObject5](docs/InlineObject5.md)
- [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md)
- [list.List](docs/List.md)
- [map_test.MapTest](docs/MapTest.md)
- [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [model200_response.Model200Response](docs/Model200Response.md)
- [model_return.ModelReturn](docs/ModelReturn.md)
- [name.Name](docs/Name.md)
- [nullable_class.NullableClass](docs/NullableClass.md)
- [number_only.NumberOnly](docs/NumberOnly.md)
- [order.Order](docs/Order.md)
- [outer_composite.OuterComposite](docs/OuterComposite.md)
- [outer_enum.OuterEnum](docs/OuterEnum.md)
- [outer_enum_default_value.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [outer_enum_integer.OuterEnumInteger](docs/OuterEnumInteger.md)
- [outer_enum_integer_default_value.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [pet.Pet](docs/Pet.md)
- [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [special_model_name.SpecialModelName](docs/SpecialModelName.md)
- [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md)
- [tag.Tag](docs/Tag.md)
- [user.User](docs/User.md)
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## api_key_query
- **Type**: API key
- **API key parameter name**: api_key_query
- **Location**: URL query string
## bearer_test
- **Type**: Bearer authentication (JWT)
## 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

View File

@ -0,0 +1,2 @@
tox
flake8

View File

@ -0,0 +1,11 @@
# additional_properties_class.AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_property** | **{str: (str,)}** | | [optional]
**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# animal.Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**color** | **str** | | [optional] if omitted the server will use the default value of '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)

View File

@ -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.Client call_123_test_special_tags(client_client)
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 pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.AnotherFakeApi()
client_client = petstore_api.Client() # client.Client | client model
# example passing only required values which don't have defaults set
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(client_client)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client_client** | [**client.Client**](Client.md)| client model |
### Return type
[**client.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)

View File

@ -0,0 +1,12 @@
# api_response.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)

View File

@ -0,0 +1,10 @@
# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**array_array_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)

View File

@ -0,0 +1,10 @@
# array_of_number_only.ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**array_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)

View File

@ -0,0 +1,12 @@
# array_test.ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**array_of_string** | **[str]** | | [optional]
**array_array_of_integer** | **[[int]]** | | [optional]
**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.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)

View File

@ -0,0 +1,15 @@
# capitalization.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)

View File

@ -0,0 +1,12 @@
# cat.Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**declawed** | **bool** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of '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)

View File

@ -0,0 +1,10 @@
# cat_all_of.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)

View File

@ -0,0 +1,11 @@
# category.Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | defaults to 'default-name'
**id** | **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)

View File

@ -0,0 +1,11 @@
# class_model.ClassModel
Model for testing model with \"_class\" property
## 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)

View File

@ -0,0 +1,10 @@
# client.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)

View File

@ -0,0 +1,56 @@
# petstore_api.DefaultApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo |
# **foo_get**
> inline_response_default.InlineResponseDefault foo_get()
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.DefaultApi()
# example, this endpoint has no required or optional parameters
try:
api_response = api_instance.foo_get()
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling DefaultApi->foo_get: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**inline_response_default.InlineResponseDefault**](InlineResponseDefault.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**0** | response | - |
[[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)

View File

@ -0,0 +1,12 @@
# dog.Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**breed** | **str** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of '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)

View File

@ -0,0 +1,10 @@
# dog_all_of.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)

View File

@ -0,0 +1,11 @@
# enum_arrays.EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional]
**array_enum** | **[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)

View File

@ -0,0 +1,10 @@
# enum_class.EnumClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | | defaults to '-efg'
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,17 @@
# enum_test.EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enum_string_required** | **str** | |
**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional]
**outer_enum_integer** | [**outer_enum_integer.OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**outer_enum_default_value** | [**outer_enum_default_value.OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**outer_enum_integer_default_value** | [**outer_enum_integer_default_value.OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.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)

View File

@ -0,0 +1,849 @@
# petstore_api.FakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
[**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 \&quot;client\&quot; 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
[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters |
# **fake_health_get**
> health_check_result.HealthCheckResult fake_health_get()
Health check endpoint
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
# example, this endpoint has no required or optional parameters
try:
# Health check endpoint
api_response = api_instance.fake_health_get()
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**health_check_result.HealthCheckResult**](HealthCheckResult.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The instance started successfully | - |
[[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()
Test serialization of outer boolean types
### Example
```python
from __future__ import print_function
import time
import petstore_api
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)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_boolean_serialize(body=body)
pprint(api_response)
except petstore_api.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**: application/json
- **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**
> outer_composite.OuterComposite fake_outer_composite_serialize()
Test serialization of object with outer number type
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outer_composite_outer_composite** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**outer_composite.OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **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()
Test serialization of outer number types
### Example
```python
from __future__ import print_function
import time
import petstore_api
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)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_number_serialize(body=body)
pprint(api_response)
except petstore_api.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**: application/json
- **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()
Test serialization of outer string types
### Example
```python
from __future__ import print_function
import time
import petstore_api
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)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_string_serialize(body=body)
pprint(api_response)
except petstore_api.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**: application/json
- **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(file_schema_test_class_file_schema_test_class)
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 pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass |
# example passing only required values which don't have defaults set
try:
api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file_schema_test_class_file_schema_test_class** | [**file_schema_test_class.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, user_user)
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
query = 'query_example' # str |
user_user = petstore_api.User() # user.User |
# example passing only required values which don't have defaults set
try:
api_instance.test_body_with_query_params(query, user_user)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **str**| |
**user_user** | [**user.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.Client test_client_model(client_client)
To test \"client\" model
To test \"client\" model
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
client_client = petstore_api.Client() # client.Client | client model
# example passing only required values which don't have defaults set
try:
# To test \"client\" model
api_response = api_instance.test_client_model(client_client)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client_client** | [**client.Client**](Client.md)| client model |
### Return type
[**client.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)
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 pprint import pprint
configuration = petstore_api.Configuration()
# Configure HTTP basic authorization: http_basic_test
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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 = open('/path/to/file', 'rb') # file_type | 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)
# example passing only required values which don't have defaults set
try:
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
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 petstore_api.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_type**| 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()
To test enum parameters
To test enum parameters
### Example
```python
from __future__ import print_function
import time
import petstore_api
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'] # [str] | Header parameter enum test (string array) (optional)
enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg'
enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional)
enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of '-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 = '$' # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of '$'
enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of '-efg'
# example passing only required values which don't have defaults set
# and optional values
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 petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional]
**enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg'
**enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional]
**enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-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** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$'
**enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-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)
Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
### Example
* Bearer (JWT) Authentication (bearer_test):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure Bearer authorization (JWT): bearer_test
configuration.access_token = 'YOUR_BEARER_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration))
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)
# example passing only required values which don't have defaults set
try:
# Fake endpoint to test group parameters (optional)
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
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 petstore_api.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
[bearer_test](../README.md#bearer_test)
### 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(request_body)
test inline additionalProperties
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
request_body = {'key': 'request_body_example'} # {str: (str,)} | request body
# example passing only required values which don't have defaults set
try:
# test inline additionalProperties
api_instance.test_inline_additional_properties(request_body)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_body** | **{str: (str,)}**| 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 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
# example passing only required values which don't have defaults set
try:
# test json serialization of form data
api_instance.test_json_form_data(param, param2)
except petstore_api.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)
# **test_query_parameter_collection_format**
> test_query_parameter_collection_format(pipe, ioutil, http, url, context)
To test the collection format in query parameters
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
pipe = ['pipe_example'] # [str] |
ioutil = ['ioutil_example'] # [str] |
http = ['http_example'] # [str] |
url = ['url_example'] # [str] |
context = ['context_example'] # [str] |
# example passing only required values which don't have defaults set
try:
api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | **[str]**| |
**ioutil** | **[str]**| |
**http** | **[str]**| |
**url** | **[str]**| |
**context** | **[str]**| |
### 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 |
|-------------|-------------|------------------|
**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)

View File

@ -0,0 +1,71 @@
# 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.Client test_classname(client_client)
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 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'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration))
client_client = petstore_api.Client() # client.Client | client model
# example passing only required values which don't have defaults set
try:
# To test class name in snake case
api_response = api_instance.test_classname(client_client)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client_client** | [**client.Client**](Client.md)| client model |
### Return type
[**client.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)

View File

@ -0,0 +1,11 @@
# file.File
Must be named `File` for test.
## 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)

View File

@ -0,0 +1,11 @@
# file_schema_test_class.FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**file.File**](File.md) | | [optional]
**files** | [**[file.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)

View File

@ -0,0 +1,10 @@
# foo.Foo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar'
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,24 @@
# format_test.FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | **float** | |
**byte** | **str** | |
**date** | **date** | |
**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
**float** | **float** | | [optional]
**double** | **float** | | [optional]
**string** | **str** | | [optional]
**binary** | **file_type** | | [optional]
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [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)

View File

@ -0,0 +1,11 @@
# has_only_read_only.HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **str** | | [optional] [readonly]
**foo** | **str** | | [optional] [readonly]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# health_check_result.HealthCheckResult
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nullable_message** | **str, none_type** | | [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)

View File

@ -0,0 +1,11 @@
# inline_object.InlineObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Updated name of the pet | [optional]
**status** | **str** | Updated status of the pet | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# inline_object1.InlineObject1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additional_metadata** | **str** | Additional data to pass to server | [optional]
**file** | **file_type** | file to upload | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# inline_object2.InlineObject2
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional]
**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg'
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,23 @@
# inline_object3.InlineObject3
## Properties
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_type** | None | [optional]
**date** | **date** | None | [optional]
**date_time** | **datetime** | None | [optional]
**password** | **str** | None | [optional]
**callback** | **str** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# inline_object4.InlineObject4
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**param** | **str** | field1 |
**param2** | **str** | field2 |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,11 @@
# inline_object5.InlineObject5
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**required_file** | **file_type** | file to upload |
**additional_metadata** | **str** | Additional data to pass to server | [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)

View File

@ -0,0 +1,10 @@
# inline_response_default.InlineResponseDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string** | [**foo.Foo**](Foo.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)

View File

@ -0,0 +1,10 @@
# list.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)

View File

@ -0,0 +1,13 @@
# map_test.MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional]
**map_of_enum_string** | **{str: (str,)}** | | [optional]
**direct_map** | **{str: (bool,)}** | | [optional]
**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.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)

View File

@ -0,0 +1,12 @@
# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**{str: (animal.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)

View File

@ -0,0 +1,12 @@
# model200_response.Model200Response
Model for testing model name starting with number
## 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)

View File

@ -0,0 +1,11 @@
# model_return.ModelReturn
Model for testing reserved words
## 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)

View File

@ -0,0 +1,14 @@
# name.Name
Model for testing model name same as property name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **int** | |
**snake_case** | **int** | | [optional] [readonly]
**_property** | **str** | | [optional]
**_123_number** | **int** | | [optional] [readonly]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,22 @@
# nullable_class.NullableClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer_prop** | **int, none_type** | | [optional]
**number_prop** | **float, none_type** | | [optional]
**boolean_prop** | **bool, none_type** | | [optional]
**string_prop** | **str, none_type** | | [optional]
**date_prop** | **date, none_type** | | [optional]
**datetime_prop** | **datetime, none_type** | | [optional]
**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional]
**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional]
**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional]
**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional]
**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [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)

View File

@ -0,0 +1,10 @@
# number_only.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)

View File

@ -0,0 +1,15 @@
# order.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] if omitted the server will use the default value of 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)

View File

@ -0,0 +1,12 @@
# outer_composite.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)

View File

@ -0,0 +1,10 @@
# outer_enum.OuterEnum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str, none_type** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# outer_enum_default_value.OuterEnumDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | | defaults to 'placed'
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# outer_enum_integer.OuterEnumInteger
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **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)

View File

@ -0,0 +1,10 @@
# outer_enum_integer_default_value.OuterEnumIntegerDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **int** | | defaults to 0
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,15 @@
# pet.Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
**photo_urls** | **[str]** | |
**id** | **int** | | [optional]
**category** | [**category.Category**](Category.md) | | [optional]
**tags** | [**[tag.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)

View File

@ -0,0 +1,597 @@
# 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(pet_pet)
Add a new pet to the store
### Example
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store
# example passing only required values which don't have defaults set
try:
# Add a new pet to the store
api_instance.add_pet(pet_pet)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_pet** | [**pet.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 |
|-------------|-------------|------------------|
**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)
Deletes a pet
### Example
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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)
# example passing only required values which don't have defaults set
try:
# Deletes a pet
api_instance.delete_pet(pet_id)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->delete_pet: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Deletes a pet
api_instance.delete_pet(pet_id, api_key=api_key)
except petstore_api.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 |
|-------------|-------------|------------------|
**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**
> [pet.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 pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
status = ['status_example'] # [str] | Status values that need to be considered for filter
# example passing only required values which don't have defaults set
try:
# Finds Pets by status
api_response = api_instance.find_pets_by_status(status)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | **[str]**| Status values that need to be considered for filter |
### Return type
[**[pet.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**
> [pet.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 pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
tags = ['tags_example'] # [str] | Tags to filter by
# example passing only required values which don't have defaults set
try:
# Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | **[str]**| Tags to filter by |
### Return type
[**[pet.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.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 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'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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
# example passing only required values which don't have defaults set
try:
# Find pet by ID
api_response = api_instance.get_pet_by_id(pet_id)
pprint(api_response)
except petstore_api.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**](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(pet_pet)
Update an existing pet
### Example
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration))
pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store
# example passing only required values which don't have defaults set
try:
# Update an existing pet
api_instance.update_pet(pet_pet)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_pet** | [**pet.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 |
|-------------|-------------|------------------|
**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)
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 pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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)
# example passing only required values which don't have defaults set
try:
# Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Updates a pet in the store with form data
api_instance.update_pet_with_form(pet_id, name=name, status=status)
except petstore_api.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**
> api_response.ApiResponse upload_file(pet_id)
uploads an image
### Example
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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 = open('/path/to/file', 'rb') # file_type | file to upload (optional)
# example passing only required values which don't have defaults set
try:
# uploads an image
api_response = api_instance.upload_file(pet_id)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# uploads an image
api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
pprint(api_response)
except petstore_api.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_type**| file to upload | [optional]
### Return type
[**api_response.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**
> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file)
uploads an image (required)
### Example
* OAuth Authentication (petstore_auth):
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
configuration = petstore_api.Configuration()
# Configure OAuth2 access token for authorization: petstore_auth
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# 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 = open('/path/to/file', 'rb') # file_type | file to upload
additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
# example passing only required values which don't have defaults set
try:
# uploads an image (required)
api_response = api_instance.upload_file_with_required_file(pet_id, required_file)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
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 petstore_api.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_type**| file to upload |
**additional_metadata** | **str**| Additional data to pass to server | [optional]
### Return type
[**api_response.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)

View File

@ -0,0 +1,11 @@
# read_only_first.ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **str** | | [optional] [readonly]
**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)

View File

@ -0,0 +1,10 @@
# special_model_name.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)

View File

@ -0,0 +1,233 @@
# 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 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
# example passing only required values which don't have defaults set
try:
# Delete purchase order by ID
api_instance.delete_order(order_id)
except petstore_api.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**
> {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 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'
# Defining host is optional and default to http://petstore.swagger.io:80/v2
configuration.host = "http://petstore.swagger.io:80/v2"
# Create an instance of the API class
api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration))
# example, this endpoint has no required or optional parameters
try:
# Returns pet inventories by status
api_response = api_instance.get_inventory()
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling StoreApi->get_inventory: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
**{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.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 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
# example passing only required values which don't have defaults set
try:
# Find purchase order by ID
api_response = api_instance.get_order_by_id(order_id)
pprint(api_response)
except petstore_api.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**](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.Order place_order(order_order)
Place an order for a pet
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.StoreApi()
order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet
# example passing only required values which don't have defaults set
try:
# Place an order for a pet
api_response = api_instance.place_order(order_order)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order_order** | [**order.Order**](Order.md)| order placed for purchasing the pet |
### Return type
[**order.Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **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)

View File

@ -0,0 +1,10 @@
# string_boolean_map.StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**any string name** | **bool** | any string name can be used but the value must be the correct type | [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)

View File

@ -0,0 +1,11 @@
# tag.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)

View File

@ -0,0 +1,17 @@
# user.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)

View 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(user_user)
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 pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
user_user = petstore_api.User() # user.User | Created user object
# example passing only required values which don't have defaults set
try:
# Create user
api_instance.create_user(user_user)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_user** | [**user.User**](User.md)| Created user object |
### 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 |
|-------------|-------------|------------------|
**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(user_user)
Creates list of users with given input array
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
user_user = [petstore_api.User()] # [user.User] | List of user object
# example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(user_user)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_user** | [**[user.User]**](User.md)| List of user object |
### 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 |
|-------------|-------------|------------------|
**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(user_user)
Creates list of users with given input array
### Example
```python
from __future__ import print_function
import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
user_user = [petstore_api.User()] # [user.User] | List of user object
# example passing only required values which don't have defaults set
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(user_user)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_user** | [**[user.User]**](User.md)| List of user object |
### 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 |
|-------------|-------------|------------------|
**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 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
# example passing only required values which don't have defaults set
try:
# Delete user
api_instance.delete_user(username)
except petstore_api.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.User get_user_by_name(username)
Get user by user name
### Example
```python
from __future__ import print_function
import time
import petstore_api
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.
# example passing only required values which don't have defaults set
try:
# Get user by user name
api_response = api_instance.get_user_by_name(username)
pprint(api_response)
except petstore_api.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**](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 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
# example passing only required values which don't have defaults set
try:
# Logs user into the system
api_response = api_instance.login_user(username, password)
pprint(api_response)
except petstore_api.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 pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
# example, this endpoint has no required or optional parameters
try:
# Logs out current logged in user session
api_instance.logout_user()
except petstore_api.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, user_user)
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 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
user_user = petstore_api.User() # user.User | Updated user object
# example passing only required values which don't have defaults set
try:
# Updated user
api_instance.update_user(username, user_user)
except petstore_api.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 |
**user_user** | [**user.User**](User.md)| Updated user object |
### 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 |
|-------------|-------------|------------------|
**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)

View File

@ -0,0 +1,58 @@
#!/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" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
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://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${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://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1,91 @@
# 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.default_api import DefaultApi
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
# import Configuration
from petstore_api.configuration import Configuration
# import exceptions
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_class import AdditionalPropertiesClass
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.foo import Foo
from petstore_api.models.format_test import FormatTest
from petstore_api.models.has_only_read_only import HasOnlyReadOnly
from petstore_api.models.health_check_result import HealthCheckResult
from petstore_api.models.inline_object import InlineObject
from petstore_api.models.inline_object1 import InlineObject1
from petstore_api.models.inline_object2 import InlineObject2
from petstore_api.models.inline_object3 import InlineObject3
from petstore_api.models.inline_object4 import InlineObject4
from petstore_api.models.inline_object5 import InlineObject5
from petstore_api.models.inline_response_default import InlineResponseDefault
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.nullable_class import NullableClass
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.outer_enum_default_value import OuterEnumDefaultValue
from petstore_api.models.outer_enum_integer import OuterEnumInteger
from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
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.string_boolean_map import StringBooleanMap
from petstore_api.models.tag import Tag
from petstore_api.models.user import User

View File

@ -0,0 +1,12 @@
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.default_api import DefaultApi
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

View File

@ -0,0 +1,378 @@
# 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
import sys # 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
)
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.models import client
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, client_client, **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(client_client, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param client.Client client_client: client model (required)
:param _return_http_data_only: response data without head status
code and headers. Default is True.
: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.
Default is None.
:param _check_input_type: boolean specifying if type checking
should be done one the data sent to the server.
Default is True.
:param _check_return_type: boolean specifying if type checking
should be done one the data received from the server.
Default is True.
:param _host_index: integer specifying the index of the server
that we want to use.
Default is 0.
:return: client.Client
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['client_client'] = \
client_client
return self.call_with_http_info(**kwargs)
self.call_123_test_special_tags = Endpoint(
settings={
'response_type': (client.Client,),
'auth': [],
'endpoint_path': '/another-fake/dummy',
'operation_id': 'call_123_test_special_tags',
'http_method': 'PATCH',
'servers': [],
},
params_map={
'all': [
'client_client',
],
'required': [
'client_client',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'client_client':
(client.Client,),
},
'attribute_map': {
},
'location_map': {
'client_client': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client,
callable=__call_123_test_special_tags
)
class Endpoint(object):
def __init__(self, settings=None, params_map=None, root_map=None,
headers_map=None, api_client=None, callable=None):
"""Creates an endpoint
Args:
settings (dict): see below key value pairs
'response_type' (tuple/None): response type
'auth' (list): a list of auth type keys
'endpoint_path' (str): the endpoint path
'operation_id' (str): endpoint string identifier
'http_method' (str): POST/PUT/PATCH/GET etc
'servers' (list): list of str servers that this endpoint is at
params_map (dict): see below key value pairs
'all' (list): list of str endpoint parameter names
'required' (list): list of required parameter names
'nullable' (list): list of nullable parameter names
'enum' (list): list of parameters with enum values
'validation' (list): list of parameters with validations
root_map
'validations' (dict): the dict mapping endpoint parameter tuple
paths to their validation dictionaries
'allowed_values' (dict): the dict mapping endpoint parameter
tuple paths to their allowed_values (enum) dictionaries
'openapi_types' (dict): param_name to openapi type
'attribute_map' (dict): param_name to camelCase name
'location_map' (dict): param_name to 'body', 'file', 'form',
'header', 'path', 'query'
collection_format_map (dict): param_name to `csv` etc.
headers_map (dict): see below key value pairs
'accept' (list): list of Accept header strings
'content_type' (list): list of Content-Type header strings
api_client (ApiClient) api client instance
callable (function): the function which is invoked when the
Endpoint is called
"""
self.settings = settings
self.params_map = params_map
self.params_map['all'].extend([
'async_req',
'_host_index',
'_preload_content',
'_request_timeout',
'_return_http_data_only',
'_check_input_type',
'_check_return_type'
])
self.params_map['nullable'].extend(['_request_timeout'])
self.validations = root_map['validations']
self.allowed_values = root_map['allowed_values']
self.openapi_types = root_map['openapi_types']
extra_types = {
'async_req': (bool,),
'_host_index': (int,),
'_preload_content': (bool,),
'_request_timeout': (none_type, int, (int,), [int]),
'_return_http_data_only': (bool,),
'_check_input_type': (bool,),
'_check_return_type': (bool,)
}
self.openapi_types.update(extra_types)
self.attribute_map = root_map['attribute_map']
self.location_map = root_map['location_map']
self.collection_format_map = root_map['collection_format_map']
self.headers_map = headers_map
self.api_client = api_client
self.callable = callable
def __validate_inputs(self, kwargs):
for param in self.params_map['enum']:
if param in kwargs:
check_allowed_values(
self.allowed_values,
(param,),
kwargs[param]
)
for param in self.params_map['validation']:
if param in kwargs:
check_validations(
self.validations,
(param,),
kwargs[param]
)
if kwargs['_check_input_type'] is False:
return
for key, value in six.iteritems(kwargs):
fixed_val = validate_and_convert_types(
value,
self.openapi_types[key],
[key],
False,
kwargs['_check_input_type'],
configuration=self.api_client.configuration
)
kwargs[key] = fixed_val
def __gather_params(self, kwargs):
params = {
'body': None,
'collection_format': {},
'file': {},
'form': [],
'header': {},
'path': {},
'query': []
}
for param_name, param_value in six.iteritems(kwargs):
param_location = self.location_map.get(param_name)
if param_location is None:
continue
if param_location:
if param_location == 'body':
params['body'] = param_value
continue
base_name = self.attribute_map[param_name]
if (param_location == 'form' and
self.openapi_types[param_name] == (file_type,)):
params['file'][param_name] = [param_value]
elif (param_location == 'form' and
self.openapi_types[param_name] == ([file_type],)):
# param_value is already a list
params['file'][param_name] = param_value
elif param_location in {'form', 'query'}:
param_value_full = (base_name, param_value)
params[param_location].append(param_value_full)
if param_location not in {'form', 'query'}:
params[param_location][base_name] = param_value
collection_format = self.collection_format_map.get(param_name)
if collection_format:
params['collection_format'][base_name] = collection_format
return params
def __call__(self, *args, **kwargs):
""" This method is invoked when endpoints are called
Example:
pet_api = PetApi()
pet_api.add_pet # this is an instance of the class Endpoint
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
which then invokes the callable functions stored in that endpoint at
pet_api.add_pet.callable or self.callable in this class
"""
return self.callable(self, *args, **kwargs)
def call_with_http_info(self, **kwargs):
try:
_host = self.settings['servers'][kwargs['_host_index']]
except IndexError:
if self.settings['servers']:
raise ApiValueError(
"Invalid host index. Must be 0 <= index < %s" %
len(self.settings['servers'])
)
_host = None
for key, value in six.iteritems(kwargs):
if key not in self.params_map['all']:
raise ApiTypeError(
"Got an unexpected parameter '%s'"
" to method `%s`" %
(key, self.settings['operation_id'])
)
# only throw this nullable ApiValueError if _check_input_type
# is False, if _check_input_type==True we catch this case
# in self.__validate_inputs
if (key not in self.params_map['nullable'] and value is None
and kwargs['_check_input_type'] is False):
raise ApiValueError(
"Value may not be None for non-nullable parameter `%s`"
" when calling `%s`" %
(key, self.settings['operation_id'])
)
for key in self.params_map['required']:
if key not in kwargs.keys():
raise ApiValueError(
"Missing the required parameter `%s` when calling "
"`%s`" % (key, self.settings['operation_id'])
)
self.__validate_inputs(kwargs)
params = self.__gather_params(kwargs)
accept_headers_list = self.headers_map['accept']
if accept_headers_list:
params['header']['Accept'] = self.api_client.select_header_accept(
accept_headers_list)
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
header_list = self.api_client.select_header_content_type(
content_type_headers_list)
params['header']['Content-Type'] = header_list
return self.api_client.call_api(
self.settings['endpoint_path'], self.settings['http_method'],
params['path'],
params['query'],
params['header'],
body=params['body'],
post_params=params['form'],
files=params['file'],
response_type=self.settings['response_type'],
auth_settings=self.settings['auth'],
async_req=kwargs['async_req'],
_check_type=kwargs['_check_return_type'],
_return_http_data_only=kwargs['_return_http_data_only'],
_preload_content=kwargs['_preload_content'],
_request_timeout=kwargs['_request_timeout'],
_host=_host,
collection_formats=params['collection_format'])

View File

@ -0,0 +1,366 @@
# 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
import sys # 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
)
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.models import inline_response_default
class DefaultApi(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 __foo_get(self, **kwargs): # noqa: E501
"""foo_get # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.foo_get(async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param _return_http_data_only: response data without head status
code and headers. Default is True.
: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.
Default is None.
:param _check_input_type: boolean specifying if type checking
should be done one the data sent to the server.
Default is True.
:param _check_return_type: boolean specifying if type checking
should be done one the data received from the server.
Default is True.
:param _host_index: integer specifying the index of the server
that we want to use.
Default is 0.
:return: inline_response_default.InlineResponseDefault
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
return self.call_with_http_info(**kwargs)
self.foo_get = Endpoint(
settings={
'response_type': (inline_response_default.InlineResponseDefault,),
'auth': [],
'endpoint_path': '/foo',
'operation_id': 'foo_get',
'http_method': 'GET',
'servers': [],
},
params_map={
'all': [
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
},
'attribute_map': {
},
'location_map': {
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client,
callable=__foo_get
)
class Endpoint(object):
def __init__(self, settings=None, params_map=None, root_map=None,
headers_map=None, api_client=None, callable=None):
"""Creates an endpoint
Args:
settings (dict): see below key value pairs
'response_type' (tuple/None): response type
'auth' (list): a list of auth type keys
'endpoint_path' (str): the endpoint path
'operation_id' (str): endpoint string identifier
'http_method' (str): POST/PUT/PATCH/GET etc
'servers' (list): list of str servers that this endpoint is at
params_map (dict): see below key value pairs
'all' (list): list of str endpoint parameter names
'required' (list): list of required parameter names
'nullable' (list): list of nullable parameter names
'enum' (list): list of parameters with enum values
'validation' (list): list of parameters with validations
root_map
'validations' (dict): the dict mapping endpoint parameter tuple
paths to their validation dictionaries
'allowed_values' (dict): the dict mapping endpoint parameter
tuple paths to their allowed_values (enum) dictionaries
'openapi_types' (dict): param_name to openapi type
'attribute_map' (dict): param_name to camelCase name
'location_map' (dict): param_name to 'body', 'file', 'form',
'header', 'path', 'query'
collection_format_map (dict): param_name to `csv` etc.
headers_map (dict): see below key value pairs
'accept' (list): list of Accept header strings
'content_type' (list): list of Content-Type header strings
api_client (ApiClient) api client instance
callable (function): the function which is invoked when the
Endpoint is called
"""
self.settings = settings
self.params_map = params_map
self.params_map['all'].extend([
'async_req',
'_host_index',
'_preload_content',
'_request_timeout',
'_return_http_data_only',
'_check_input_type',
'_check_return_type'
])
self.params_map['nullable'].extend(['_request_timeout'])
self.validations = root_map['validations']
self.allowed_values = root_map['allowed_values']
self.openapi_types = root_map['openapi_types']
extra_types = {
'async_req': (bool,),
'_host_index': (int,),
'_preload_content': (bool,),
'_request_timeout': (none_type, int, (int,), [int]),
'_return_http_data_only': (bool,),
'_check_input_type': (bool,),
'_check_return_type': (bool,)
}
self.openapi_types.update(extra_types)
self.attribute_map = root_map['attribute_map']
self.location_map = root_map['location_map']
self.collection_format_map = root_map['collection_format_map']
self.headers_map = headers_map
self.api_client = api_client
self.callable = callable
def __validate_inputs(self, kwargs):
for param in self.params_map['enum']:
if param in kwargs:
check_allowed_values(
self.allowed_values,
(param,),
kwargs[param]
)
for param in self.params_map['validation']:
if param in kwargs:
check_validations(
self.validations,
(param,),
kwargs[param]
)
if kwargs['_check_input_type'] is False:
return
for key, value in six.iteritems(kwargs):
fixed_val = validate_and_convert_types(
value,
self.openapi_types[key],
[key],
False,
kwargs['_check_input_type'],
configuration=self.api_client.configuration
)
kwargs[key] = fixed_val
def __gather_params(self, kwargs):
params = {
'body': None,
'collection_format': {},
'file': {},
'form': [],
'header': {},
'path': {},
'query': []
}
for param_name, param_value in six.iteritems(kwargs):
param_location = self.location_map.get(param_name)
if param_location is None:
continue
if param_location:
if param_location == 'body':
params['body'] = param_value
continue
base_name = self.attribute_map[param_name]
if (param_location == 'form' and
self.openapi_types[param_name] == (file_type,)):
params['file'][param_name] = [param_value]
elif (param_location == 'form' and
self.openapi_types[param_name] == ([file_type],)):
# param_value is already a list
params['file'][param_name] = param_value
elif param_location in {'form', 'query'}:
param_value_full = (base_name, param_value)
params[param_location].append(param_value_full)
if param_location not in {'form', 'query'}:
params[param_location][base_name] = param_value
collection_format = self.collection_format_map.get(param_name)
if collection_format:
params['collection_format'][base_name] = collection_format
return params
def __call__(self, *args, **kwargs):
""" This method is invoked when endpoints are called
Example:
pet_api = PetApi()
pet_api.add_pet # this is an instance of the class Endpoint
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
which then invokes the callable functions stored in that endpoint at
pet_api.add_pet.callable or self.callable in this class
"""
return self.callable(self, *args, **kwargs)
def call_with_http_info(self, **kwargs):
try:
_host = self.settings['servers'][kwargs['_host_index']]
except IndexError:
if self.settings['servers']:
raise ApiValueError(
"Invalid host index. Must be 0 <= index < %s" %
len(self.settings['servers'])
)
_host = None
for key, value in six.iteritems(kwargs):
if key not in self.params_map['all']:
raise ApiTypeError(
"Got an unexpected parameter '%s'"
" to method `%s`" %
(key, self.settings['operation_id'])
)
# only throw this nullable ApiValueError if _check_input_type
# is False, if _check_input_type==True we catch this case
# in self.__validate_inputs
if (key not in self.params_map['nullable'] and value is None
and kwargs['_check_input_type'] is False):
raise ApiValueError(
"Value may not be None for non-nullable parameter `%s`"
" when calling `%s`" %
(key, self.settings['operation_id'])
)
for key in self.params_map['required']:
if key not in kwargs.keys():
raise ApiValueError(
"Missing the required parameter `%s` when calling "
"`%s`" % (key, self.settings['operation_id'])
)
self.__validate_inputs(kwargs)
params = self.__gather_params(kwargs)
accept_headers_list = self.headers_map['accept']
if accept_headers_list:
params['header']['Accept'] = self.api_client.select_header_accept(
accept_headers_list)
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
header_list = self.api_client.select_header_content_type(
content_type_headers_list)
params['header']['Content-Type'] = header_list
return self.api_client.call_api(
self.settings['endpoint_path'], self.settings['http_method'],
params['path'],
params['query'],
params['header'],
body=params['body'],
post_params=params['form'],
files=params['file'],
response_type=self.settings['response_type'],
auth_settings=self.settings['auth'],
async_req=kwargs['async_req'],
_check_type=kwargs['_check_return_type'],
_return_http_data_only=kwargs['_return_http_data_only'],
_preload_content=kwargs['_preload_content'],
_request_timeout=kwargs['_request_timeout'],
_host=_host,
collection_formats=params['collection_format'])

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,380 @@
# 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
import sys # 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
)
from petstore_api.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
int,
none_type,
str,
validate_and_convert_types
)
from petstore_api.models import client
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, client_client, **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(client_client, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param client.Client client_client: client model (required)
:param _return_http_data_only: response data without head status
code and headers. Default is True.
: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.
Default is None.
:param _check_input_type: boolean specifying if type checking
should be done one the data sent to the server.
Default is True.
:param _check_return_type: boolean specifying if type checking
should be done one the data received from the server.
Default is True.
:param _host_index: integer specifying the index of the server
that we want to use.
Default is 0.
:return: client.Client
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['client_client'] = \
client_client
return self.call_with_http_info(**kwargs)
self.test_classname = Endpoint(
settings={
'response_type': (client.Client,),
'auth': [
'api_key_query'
],
'endpoint_path': '/fake_classname_test',
'operation_id': 'test_classname',
'http_method': 'PATCH',
'servers': [],
},
params_map={
'all': [
'client_client',
],
'required': [
'client_client',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'client_client':
(client.Client,),
},
'attribute_map': {
},
'location_map': {
'client_client': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json'
]
},
api_client=api_client,
callable=__test_classname
)
class Endpoint(object):
def __init__(self, settings=None, params_map=None, root_map=None,
headers_map=None, api_client=None, callable=None):
"""Creates an endpoint
Args:
settings (dict): see below key value pairs
'response_type' (tuple/None): response type
'auth' (list): a list of auth type keys
'endpoint_path' (str): the endpoint path
'operation_id' (str): endpoint string identifier
'http_method' (str): POST/PUT/PATCH/GET etc
'servers' (list): list of str servers that this endpoint is at
params_map (dict): see below key value pairs
'all' (list): list of str endpoint parameter names
'required' (list): list of required parameter names
'nullable' (list): list of nullable parameter names
'enum' (list): list of parameters with enum values
'validation' (list): list of parameters with validations
root_map
'validations' (dict): the dict mapping endpoint parameter tuple
paths to their validation dictionaries
'allowed_values' (dict): the dict mapping endpoint parameter
tuple paths to their allowed_values (enum) dictionaries
'openapi_types' (dict): param_name to openapi type
'attribute_map' (dict): param_name to camelCase name
'location_map' (dict): param_name to 'body', 'file', 'form',
'header', 'path', 'query'
collection_format_map (dict): param_name to `csv` etc.
headers_map (dict): see below key value pairs
'accept' (list): list of Accept header strings
'content_type' (list): list of Content-Type header strings
api_client (ApiClient) api client instance
callable (function): the function which is invoked when the
Endpoint is called
"""
self.settings = settings
self.params_map = params_map
self.params_map['all'].extend([
'async_req',
'_host_index',
'_preload_content',
'_request_timeout',
'_return_http_data_only',
'_check_input_type',
'_check_return_type'
])
self.params_map['nullable'].extend(['_request_timeout'])
self.validations = root_map['validations']
self.allowed_values = root_map['allowed_values']
self.openapi_types = root_map['openapi_types']
extra_types = {
'async_req': (bool,),
'_host_index': (int,),
'_preload_content': (bool,),
'_request_timeout': (none_type, int, (int,), [int]),
'_return_http_data_only': (bool,),
'_check_input_type': (bool,),
'_check_return_type': (bool,)
}
self.openapi_types.update(extra_types)
self.attribute_map = root_map['attribute_map']
self.location_map = root_map['location_map']
self.collection_format_map = root_map['collection_format_map']
self.headers_map = headers_map
self.api_client = api_client
self.callable = callable
def __validate_inputs(self, kwargs):
for param in self.params_map['enum']:
if param in kwargs:
check_allowed_values(
self.allowed_values,
(param,),
kwargs[param]
)
for param in self.params_map['validation']:
if param in kwargs:
check_validations(
self.validations,
(param,),
kwargs[param]
)
if kwargs['_check_input_type'] is False:
return
for key, value in six.iteritems(kwargs):
fixed_val = validate_and_convert_types(
value,
self.openapi_types[key],
[key],
False,
kwargs['_check_input_type'],
configuration=self.api_client.configuration
)
kwargs[key] = fixed_val
def __gather_params(self, kwargs):
params = {
'body': None,
'collection_format': {},
'file': {},
'form': [],
'header': {},
'path': {},
'query': []
}
for param_name, param_value in six.iteritems(kwargs):
param_location = self.location_map.get(param_name)
if param_location is None:
continue
if param_location:
if param_location == 'body':
params['body'] = param_value
continue
base_name = self.attribute_map[param_name]
if (param_location == 'form' and
self.openapi_types[param_name] == (file_type,)):
params['file'][param_name] = [param_value]
elif (param_location == 'form' and
self.openapi_types[param_name] == ([file_type],)):
# param_value is already a list
params['file'][param_name] = param_value
elif param_location in {'form', 'query'}:
param_value_full = (base_name, param_value)
params[param_location].append(param_value_full)
if param_location not in {'form', 'query'}:
params[param_location][base_name] = param_value
collection_format = self.collection_format_map.get(param_name)
if collection_format:
params['collection_format'][base_name] = collection_format
return params
def __call__(self, *args, **kwargs):
""" This method is invoked when endpoints are called
Example:
pet_api = PetApi()
pet_api.add_pet # this is an instance of the class Endpoint
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
which then invokes the callable functions stored in that endpoint at
pet_api.add_pet.callable or self.callable in this class
"""
return self.callable(self, *args, **kwargs)
def call_with_http_info(self, **kwargs):
try:
_host = self.settings['servers'][kwargs['_host_index']]
except IndexError:
if self.settings['servers']:
raise ApiValueError(
"Invalid host index. Must be 0 <= index < %s" %
len(self.settings['servers'])
)
_host = None
for key, value in six.iteritems(kwargs):
if key not in self.params_map['all']:
raise ApiTypeError(
"Got an unexpected parameter '%s'"
" to method `%s`" %
(key, self.settings['operation_id'])
)
# only throw this nullable ApiValueError if _check_input_type
# is False, if _check_input_type==True we catch this case
# in self.__validate_inputs
if (key not in self.params_map['nullable'] and value is None
and kwargs['_check_input_type'] is False):
raise ApiValueError(
"Value may not be None for non-nullable parameter `%s`"
" when calling `%s`" %
(key, self.settings['operation_id'])
)
for key in self.params_map['required']:
if key not in kwargs.keys():
raise ApiValueError(
"Missing the required parameter `%s` when calling "
"`%s`" % (key, self.settings['operation_id'])
)
self.__validate_inputs(kwargs)
params = self.__gather_params(kwargs)
accept_headers_list = self.headers_map['accept']
if accept_headers_list:
params['header']['Accept'] = self.api_client.select_header_accept(
accept_headers_list)
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
header_list = self.api_client.select_header_content_type(
content_type_headers_list)
params['header']['Content-Type'] = header_list
return self.api_client.call_api(
self.settings['endpoint_path'], self.settings['http_method'],
params['path'],
params['query'],
params['header'],
body=params['body'],
post_params=params['form'],
files=params['file'],
response_type=self.settings['response_type'],
auth_settings=self.settings['auth'],
async_req=kwargs['async_req'],
_check_type=kwargs['_check_return_type'],
_return_http_data_only=kwargs['_return_http_data_only'],
_preload_content=kwargs['_preload_content'],
_request_timeout=kwargs['_request_timeout'],
_host=_host,
collection_formats=params['collection_format'])

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More