Merge remote-tracking branch 'origin/master' into 5.0.x

This commit is contained in:
William Cheng
2020-02-04 15:31:10 +08:00
1179 changed files with 58478 additions and 9334 deletions

View File

@@ -53,17 +53,19 @@ 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))
body = petstore_api.Client() # client.Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.AnotherFakeApi(api_client)
body = petstore_api.Client() # client.Client | client model
try:
# To test special tags
api_response = api_instance.call_123_test_special_tags(body)
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

View File

@@ -22,17 +22,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.AnotherFakeApi()
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.AnotherFakeApi(api_client)
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
```
### Parameters

View File

@@ -36,16 +36,18 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body
# example passing only required values which don't have defaults set
try:
# creates an XmlItem
api_instance.create_xml_item(xml_item)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->create_xml_item: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body
# example passing only required values which don't have defaults set
try:
# creates an XmlItem
api_instance.create_xml_item(xml_item)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->create_xml_item: %s\n" % e)
```
### Parameters
@@ -89,17 +91,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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)
# 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
@@ -143,17 +147,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
body = 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(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_composite_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
```
### Parameters
@@ -197,17 +203,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum 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_enum_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.fake_outer_enum_serialize(body=body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e)
```
### Parameters
@@ -251,17 +259,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | 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)
# 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
@@ -305,17 +315,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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)
# 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
@@ -359,15 +371,17 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
```
### Parameters
@@ -409,16 +423,18 @@ 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 |
body = 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, body)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
query = 'query_example' # str |
body = 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, body)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
```
### Parameters
@@ -463,17 +479,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_client_model: %s\n" % e)
```
### Parameters
@@ -517,14 +535,16 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
# example passing only required values which don't have defaults set
try:
api_instance.test_endpoint_enums_length_one()
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
# example passing only required values which don't have defaults set
try:
api_instance.test_endpoint_enums_length_one()
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e)
```
### Parameters
@@ -579,13 +599,15 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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)
@@ -596,20 +618,20 @@ 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
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)
# 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
@@ -667,9 +689,11 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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'
@@ -678,13 +702,13 @@ 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)
# 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
@@ -736,29 +760,31 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
required_string_group = 56 # int | Required String in group parameters
required_boolean_group = True # bool | Required Boolean in group parameters
required_int64_group = 56 # int | Required Integer in group parameters
string_group = 56 # int | String in group parameters (optional)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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
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)
# 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
@@ -805,16 +831,18 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
param = {'key': 'param_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(param)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
param = {'key': 'param_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(param)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
```
### Parameters
@@ -856,17 +884,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
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

View File

@@ -30,17 +30,19 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# 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))
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeClassnameTags123Api(api_client)
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
```
### Parameters

View File

@@ -34,16 +34,18 @@ 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))
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
### Parameters
@@ -92,25 +94,27 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
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)
# 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
@@ -162,17 +166,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
@@ -223,17 +229,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
@@ -286,17 +294,19 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
@@ -346,16 +356,18 @@ 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))
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
### Parameters
@@ -406,26 +418,28 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
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)
# 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
@@ -475,29 +489,31 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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)
files = open('/path/to/file', 'rb') # [file_type] | files 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
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, files=files)
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, files=files)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling PetApi->upload_file: %s\n" % e)
```
### Parameters
@@ -548,28 +564,30 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
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
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)
# 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

View File

@@ -25,16 +25,18 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.StoreApi(api_client)
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
@@ -87,16 +89,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY'
# 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.StoreApi(api_client)
# 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
@@ -137,17 +141,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.StoreApi(api_client)
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
@@ -191,17 +197,19 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.StoreApi()
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.StoreApi(api_client)
body = 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(body)
pprint(api_response)
except petstore_api.ApiException as e:
print("Exception when calling StoreApi->place_order: %s\n" % e)
```
### Parameters

View File

@@ -29,16 +29,18 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
body = 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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
### Parameters
@@ -80,16 +82,18 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
body = [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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
body = [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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
### Parameters
@@ -131,16 +135,18 @@ import time
import petstore_api
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.UserApi()
body = [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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
body = [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(body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
### Parameters
@@ -184,16 +190,18 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
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
@@ -236,17 +244,19 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
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
@@ -290,18 +300,20 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
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
@@ -345,15 +357,17 @@ 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)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
# 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
@@ -394,17 +408,19 @@ 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
body = 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, body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.UserApi(api_client)
username = 'username_example' # str | name that need to be deleted
body = 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, body)
except petstore_api.ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
### Parameters

View File

@@ -49,7 +49,11 @@ class AnotherFakeApi(object):
api_client = ApiClient()
self.api_client = api_client
def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501
def __call_123_test_special_tags(
self,
body,
**kwargs
):
"""To test special tags # noqa: E501
To test special tags and operation ID starting with number # noqa: E501
@@ -58,30 +62,34 @@ class AnotherFakeApi(object):
>>> thread = api.call_123_test_special_tags(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param client.Client body: 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.
Args:
body (client.Client): client model
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
client.Client
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -102,7 +110,8 @@ class AnotherFakeApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.call_123_test_special_tags = Endpoint(
@@ -134,7 +143,8 @@ class AnotherFakeApi(object):
'allowed_values': {
},
'openapi_types': {
'body': (client.Client,),
'body':
(client.Client,),
},
'attribute_map': {
},

View File

@@ -49,7 +49,11 @@ class FakeClassnameTags123Api(object):
api_client = ApiClient()
self.api_client = api_client
def __test_classname(self, body, **kwargs): # noqa: E501
def __test_classname(
self,
body,
**kwargs
):
"""To test class name in snake case # noqa: E501
To test class name in snake case # noqa: E501
@@ -58,30 +62,34 @@ class FakeClassnameTags123Api(object):
>>> thread = api.test_classname(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param client.Client body: 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.
Args:
body (client.Client): client model
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
client.Client
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -102,7 +110,8 @@ class FakeClassnameTags123Api(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.test_classname = Endpoint(
@@ -136,7 +145,8 @@ class FakeClassnameTags123Api(object):
'allowed_values': {
},
'openapi_types': {
'body': (client.Client,),
'body':
(client.Client,),
},
'attribute_map': {
},

View File

@@ -50,7 +50,11 @@ class PetApi(object):
api_client = ApiClient()
self.api_client = api_client
def __add_pet(self, body, **kwargs): # noqa: E501
def __add_pet(
self,
body,
**kwargs
):
"""Add a new pet to the store # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -58,30 +62,34 @@ class PetApi(object):
>>> thread = api.add_pet(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param pet.Pet body: Pet object that needs to be added to the store (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: None
If the method is called asynchronously, returns the request
thread.
Args:
body (pet.Pet): Pet object that needs to be added to the store
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -102,7 +110,8 @@ class PetApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.add_pet = Endpoint(
@@ -136,7 +145,8 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'body': (pet.Pet,),
'body':
(pet.Pet,),
},
'attribute_map': {
},
@@ -157,7 +167,11 @@ class PetApi(object):
callable=__add_pet
)
def __delete_pet(self, pet_id, **kwargs): # noqa: E501
def __delete_pet(
self,
pet_id,
**kwargs
):
"""Deletes a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -165,31 +179,35 @@ class PetApi(object):
>>> thread = api.delete_pet(pet_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int pet_id: Pet id to delete (required)
:param str api_key:
: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: None
If the method is called asynchronously, returns the request
thread.
Args:
pet_id (int): Pet id to delete
Keyword Args:
api_key (str): [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -210,7 +228,8 @@ class PetApi(object):
'_check_return_type', True
)
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)
self.delete_pet = Endpoint(
@@ -245,8 +264,10 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'pet_id': (int,),
'api_key': (str,),
'pet_id':
(int,),
'api_key':
(str,),
},
'attribute_map': {
'pet_id': 'petId',
@@ -267,7 +288,11 @@ class PetApi(object):
callable=__delete_pet
)
def __find_pets_by_status(self, status, **kwargs): # noqa: E501
def __find_pets_by_status(
self,
status,
**kwargs
):
"""Finds Pets by status # noqa: E501
Multiple status values can be provided with comma separated strings # noqa: E501
@@ -276,30 +301,34 @@ class PetApi(object):
>>> thread = api.find_pets_by_status(status, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param [str] status: Status values that need to be considered for filter (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: [pet.Pet]
If the method is called asynchronously, returns the request
thread.
Args:
status ([str]): Status values that need to be considered for filter
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
[pet.Pet]
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -320,7 +349,8 @@ class PetApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['status'] = status
kwargs['status'] = \
status
return self.call_with_http_info(**kwargs)
self.find_pets_by_status = Endpoint(
@@ -361,7 +391,8 @@ class PetApi(object):
},
},
'openapi_types': {
'status': ([str],),
'status':
([str],),
},
'attribute_map': {
'status': 'status',
@@ -384,7 +415,11 @@ class PetApi(object):
callable=__find_pets_by_status
)
def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501
def __find_pets_by_tags(
self,
tags,
**kwargs
):
"""Finds Pets by tags # noqa: E501
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
@@ -393,30 +428,34 @@ class PetApi(object):
>>> thread = api.find_pets_by_tags(tags, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param [str] tags: Tags to filter by (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: [pet.Pet]
If the method is called asynchronously, returns the request
thread.
Args:
tags ([str]): Tags to filter by
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
[pet.Pet]
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -437,7 +476,8 @@ class PetApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['tags'] = tags
kwargs['tags'] = \
tags
return self.call_with_http_info(**kwargs)
self.find_pets_by_tags = Endpoint(
@@ -471,7 +511,8 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'tags': ([str],),
'tags':
([str],),
},
'attribute_map': {
'tags': 'tags',
@@ -494,7 +535,11 @@ class PetApi(object):
callable=__find_pets_by_tags
)
def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501
def __get_pet_by_id(
self,
pet_id,
**kwargs
):
"""Find pet by ID # noqa: E501
Returns a single pet # noqa: E501
@@ -503,30 +548,34 @@ class PetApi(object):
>>> thread = api.get_pet_by_id(pet_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int pet_id: ID of pet to return (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: pet.Pet
If the method is called asynchronously, returns the request
thread.
Args:
pet_id (int): ID of pet to return
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
pet.Pet
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -547,7 +596,8 @@ class PetApi(object):
'_check_return_type', True
)
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)
self.get_pet_by_id = Endpoint(
@@ -581,7 +631,8 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'pet_id': (int,),
'pet_id':
(int,),
},
'attribute_map': {
'pet_id': 'petId',
@@ -603,7 +654,11 @@ class PetApi(object):
callable=__get_pet_by_id
)
def __update_pet(self, body, **kwargs): # noqa: E501
def __update_pet(
self,
body,
**kwargs
):
"""Update an existing pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -611,30 +666,34 @@ class PetApi(object):
>>> thread = api.update_pet(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param pet.Pet body: Pet object that needs to be added to the store (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: None
If the method is called asynchronously, returns the request
thread.
Args:
body (pet.Pet): Pet object that needs to be added to the store
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -655,7 +714,8 @@ class PetApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.update_pet = Endpoint(
@@ -689,7 +749,8 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'body': (pet.Pet,),
'body':
(pet.Pet,),
},
'attribute_map': {
},
@@ -710,7 +771,11 @@ class PetApi(object):
callable=__update_pet
)
def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501
def __update_pet_with_form(
self,
pet_id,
**kwargs
):
"""Updates a pet in the store with form data # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -718,32 +783,36 @@ class PetApi(object):
>>> thread = api.update_pet_with_form(pet_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int pet_id: ID of pet that needs to be updated (required)
:param str name: Updated name of the pet
:param str status: Updated status of the pet
: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: None
If the method is called asynchronously, returns the request
thread.
Args:
pet_id (int): ID of pet that needs to be updated
Keyword Args:
name (str): Updated name of the pet. [optional]
status (str): Updated status of the pet. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -764,7 +833,8 @@ class PetApi(object):
'_check_return_type', True
)
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)
self.update_pet_with_form = Endpoint(
@@ -800,9 +870,12 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'pet_id': (int,),
'name': (str,),
'status': (str,),
'pet_id':
(int,),
'name':
(str,),
'status':
(str,),
},
'attribute_map': {
'pet_id': 'petId',
@@ -827,7 +900,11 @@ class PetApi(object):
callable=__update_pet_with_form
)
def __upload_file(self, pet_id, **kwargs): # noqa: E501
def __upload_file(
self,
pet_id,
**kwargs
):
"""uploads an image # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -835,33 +912,37 @@ class PetApi(object):
>>> thread = api.upload_file(pet_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int pet_id: ID of pet to update (required)
:param str additional_metadata: Additional data to pass to server
:param file_type file: file to upload
:param [file_type] files: files to upload
: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: api_response.ApiResponse
If the method is called asynchronously, returns the request
thread.
Args:
pet_id (int): ID of pet to update
Keyword Args:
additional_metadata (str): Additional data to pass to server. [optional]
file (file_type): file to upload. [optional]
files ([file_type]): files to upload. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
api_response.ApiResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -882,7 +963,8 @@ class PetApi(object):
'_check_return_type', True
)
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)
self.upload_file = Endpoint(
@@ -919,10 +1001,14 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'pet_id': (int,),
'additional_metadata': (str,),
'file': (file_type,),
'files': ([file_type],),
'pet_id':
(int,),
'additional_metadata':
(str,),
'file':
(file_type,),
'files':
([file_type],),
},
'attribute_map': {
'pet_id': 'petId',
@@ -952,7 +1038,12 @@ class PetApi(object):
callable=__upload_file
)
def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501
def __upload_file_with_required_file(
self,
pet_id,
required_file,
**kwargs
):
"""uploads an image (required) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -960,32 +1051,36 @@ class PetApi(object):
>>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int pet_id: ID of pet to update (required)
:param file_type required_file: file to upload (required)
:param str additional_metadata: Additional data to pass to server
: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: api_response.ApiResponse
If the method is called asynchronously, returns the request
thread.
Args:
pet_id (int): ID of pet to update
required_file (file_type): file to upload
Keyword Args:
additional_metadata (str): Additional data to pass to server. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
api_response.ApiResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -1006,8 +1101,10 @@ class PetApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['pet_id'] = pet_id
kwargs['required_file'] = required_file
kwargs['pet_id'] = \
pet_id
kwargs['required_file'] = \
required_file
return self.call_with_http_info(**kwargs)
self.upload_file_with_required_file = Endpoint(
@@ -1044,9 +1141,12 @@ class PetApi(object):
'allowed_values': {
},
'openapi_types': {
'pet_id': (int,),
'required_file': (file_type,),
'additional_metadata': (str,),
'pet_id':
(int,),
'required_file':
(file_type,),
'additional_metadata':
(str,),
},
'attribute_map': {
'pet_id': 'petId',

View File

@@ -49,7 +49,11 @@ class StoreApi(object):
api_client = ApiClient()
self.api_client = api_client
def __delete_order(self, order_id, **kwargs): # noqa: E501
def __delete_order(
self,
order_id,
**kwargs
):
"""Delete purchase order by ID # noqa: E501
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501
@@ -58,30 +62,34 @@ class StoreApi(object):
>>> thread = api.delete_order(order_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param str order_id: ID of the order that needs to be deleted (required)
:param _return_http_data_only: response data without head status
code and headers. 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: None
If the method is called asynchronously, returns the request
thread.
Args:
order_id (str): ID of the order that needs to be deleted
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -102,7 +110,8 @@ class StoreApi(object):
'_check_return_type', True
)
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)
self.delete_order = Endpoint(
@@ -134,7 +143,8 @@ class StoreApi(object):
'allowed_values': {
},
'openapi_types': {
'order_id': (str,),
'order_id':
(str,),
},
'attribute_map': {
'order_id': 'order_id',
@@ -153,7 +163,10 @@ class StoreApi(object):
callable=__delete_order
)
def __get_inventory(self, **kwargs): # noqa: E501
def __get_inventory(
self,
**kwargs
):
"""Returns pet inventories by status # noqa: E501
Returns a map of status codes to quantities # noqa: E501
@@ -162,29 +175,32 @@ class StoreApi(object):
>>> thread = api.get_inventory(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: {str: (int,)}
If the method is called asynchronously, returns the request
thread.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
{str: (int,)}
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -253,7 +269,11 @@ class StoreApi(object):
callable=__get_inventory
)
def __get_order_by_id(self, order_id, **kwargs): # noqa: E501
def __get_order_by_id(
self,
order_id,
**kwargs
):
"""Find purchase order by ID # noqa: E501
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501
@@ -262,30 +282,34 @@ class StoreApi(object):
>>> thread = api.get_order_by_id(order_id, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param int order_id: ID of pet that needs to be fetched (required)
:param _return_http_data_only: response data without head status
code and headers. 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: order.Order
If the method is called asynchronously, returns the request
thread.
Args:
order_id (int): ID of pet that needs to be fetched
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
order.Order
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -306,7 +330,8 @@ class StoreApi(object):
'_check_return_type', True
)
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)
self.get_order_by_id = Endpoint(
@@ -344,7 +369,8 @@ class StoreApi(object):
'allowed_values': {
},
'openapi_types': {
'order_id': (int,),
'order_id':
(int,),
},
'attribute_map': {
'order_id': 'order_id',
@@ -366,7 +392,11 @@ class StoreApi(object):
callable=__get_order_by_id
)
def __place_order(self, body, **kwargs): # noqa: E501
def __place_order(
self,
body,
**kwargs
):
"""Place an order for a pet # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -374,30 +404,34 @@ class StoreApi(object):
>>> thread = api.place_order(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param order.Order body: order placed for purchasing the pet (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: order.Order
If the method is called asynchronously, returns the request
thread.
Args:
body (order.Order): order placed for purchasing the pet
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
order.Order
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -418,7 +452,8 @@ class StoreApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.place_order = Endpoint(
@@ -450,7 +485,8 @@ class StoreApi(object):
'allowed_values': {
},
'openapi_types': {
'body': (order.Order,),
'body':
(order.Order,),
},
'attribute_map': {
},

View File

@@ -49,7 +49,11 @@ class UserApi(object):
api_client = ApiClient()
self.api_client = api_client
def __create_user(self, body, **kwargs): # noqa: E501
def __create_user(
self,
body,
**kwargs
):
"""Create user # noqa: E501
This can only be done by the logged in user. # noqa: E501
@@ -58,30 +62,34 @@ class UserApi(object):
>>> thread = api.create_user(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param user.User body: Created user object (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: None
If the method is called asynchronously, returns the request
thread.
Args:
body (user.User): Created user object
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -102,7 +110,8 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.create_user = Endpoint(
@@ -134,7 +143,8 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'body': (user.User,),
'body':
(user.User,),
},
'attribute_map': {
},
@@ -152,7 +162,11 @@ class UserApi(object):
callable=__create_user
)
def __create_users_with_array_input(self, body, **kwargs): # noqa: E501
def __create_users_with_array_input(
self,
body,
**kwargs
):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -160,30 +174,34 @@ class UserApi(object):
>>> thread = api.create_users_with_array_input(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param [user.User] body: List of user object (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: None
If the method is called asynchronously, returns the request
thread.
Args:
body ([user.User]): List of user object
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -204,7 +222,8 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.create_users_with_array_input = Endpoint(
@@ -236,7 +255,8 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'body': ([user.User],),
'body':
([user.User],),
},
'attribute_map': {
},
@@ -254,7 +274,11 @@ class UserApi(object):
callable=__create_users_with_array_input
)
def __create_users_with_list_input(self, body, **kwargs): # noqa: E501
def __create_users_with_list_input(
self,
body,
**kwargs
):
"""Creates list of users with given input array # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -262,30 +286,34 @@ class UserApi(object):
>>> thread = api.create_users_with_list_input(body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param [user.User] body: List of user object (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: None
If the method is called asynchronously, returns the request
thread.
Args:
body ([user.User]): List of user object
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -306,7 +334,8 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['body'] = body
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.create_users_with_list_input = Endpoint(
@@ -338,7 +367,8 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'body': ([user.User],),
'body':
([user.User],),
},
'attribute_map': {
},
@@ -356,7 +386,11 @@ class UserApi(object):
callable=__create_users_with_list_input
)
def __delete_user(self, username, **kwargs): # noqa: E501
def __delete_user(
self,
username,
**kwargs
):
"""Delete user # noqa: E501
This can only be done by the logged in user. # noqa: E501
@@ -365,30 +399,34 @@ class UserApi(object):
>>> thread = api.delete_user(username, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param str username: The name that needs to be deleted (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: None
If the method is called asynchronously, returns the request
thread.
Args:
username (str): The name that needs to be deleted
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -409,7 +447,8 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username
kwargs['username'] = \
username
return self.call_with_http_info(**kwargs)
self.delete_user = Endpoint(
@@ -441,7 +480,8 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'username': (str,),
'username':
(str,),
},
'attribute_map': {
'username': 'username',
@@ -460,7 +500,11 @@ class UserApi(object):
callable=__delete_user
)
def __get_user_by_name(self, username, **kwargs): # noqa: E501
def __get_user_by_name(
self,
username,
**kwargs
):
"""Get user by user name # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -468,30 +512,34 @@ class UserApi(object):
>>> thread = api.get_user_by_name(username, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param str username: The name that needs to be fetched. Use user1 for testing. (required)
:param _return_http_data_only: response data without head status
code and headers. 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: user.User
If the method is called asynchronously, returns the request
thread.
Args:
username (str): The name that needs to be fetched. Use user1 for testing.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
user.User
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -512,7 +560,8 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username
kwargs['username'] = \
username
return self.call_with_http_info(**kwargs)
self.get_user_by_name = Endpoint(
@@ -544,7 +593,8 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'username': (str,),
'username':
(str,),
},
'attribute_map': {
'username': 'username',
@@ -566,7 +616,12 @@ class UserApi(object):
callable=__get_user_by_name
)
def __login_user(self, username, password, **kwargs): # noqa: E501
def __login_user(
self,
username,
password,
**kwargs
):
"""Logs user into the system # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -574,31 +629,35 @@ class UserApi(object):
>>> thread = api.login_user(username, password, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param str username: The user name for login (required)
:param str password: The password for login in clear text (required)
:param _return_http_data_only: response data without head status
code and headers. 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: str
If the method is called asynchronously, returns the request
thread.
Args:
username (str): The user name for login
password (str): The password for login in clear text
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
str
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -619,8 +678,10 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username
kwargs['password'] = password
kwargs['username'] = \
username
kwargs['password'] = \
password
return self.call_with_http_info(**kwargs)
self.login_user = Endpoint(
@@ -654,8 +715,10 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'username': (str,),
'password': (str,),
'username':
(str,),
'password':
(str,),
},
'attribute_map': {
'username': 'username',
@@ -679,7 +742,10 @@ class UserApi(object):
callable=__login_user
)
def __logout_user(self, **kwargs): # noqa: E501
def __logout_user(
self,
**kwargs
):
"""Logs out current logged in user session # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -687,29 +753,32 @@ class UserApi(object):
>>> thread = api.logout_user(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: None
If the method is called asynchronously, returns the request
thread.
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -774,7 +843,12 @@ class UserApi(object):
callable=__logout_user
)
def __update_user(self, username, body, **kwargs): # noqa: E501
def __update_user(
self,
username,
body,
**kwargs
):
"""Updated user # noqa: E501
This can only be done by the logged in user. # noqa: E501
@@ -783,31 +857,35 @@ class UserApi(object):
>>> thread = api.update_user(username, body, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
Default is False.
:param str username: name that need to be deleted (required)
:param user.User body: Updated user object (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: None
If the method is called asynchronously, returns the request
thread.
Args:
username (str): name that need to be deleted
body (user.User): Updated user object
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): 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.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int): specifies the index of the server
that we want to use.
Default is 0.
async_req (bool): execute request asynchronously
Returns:
None
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
@@ -828,8 +906,10 @@ class UserApi(object):
'_check_return_type', True
)
kwargs['_host_index'] = kwargs.get('_host_index', 0)
kwargs['username'] = username
kwargs['body'] = body
kwargs['username'] = \
username
kwargs['body'] = \
body
return self.call_with_http_info(**kwargs)
self.update_user = Endpoint(
@@ -863,8 +943,10 @@ class UserApi(object):
'allowed_values': {
},
'openapi_types': {
'username': (str,),
'body': (user.User,),
'username':
(str,),
'body':
(user.User,),
},
'attribute_map': {
'username': 'username',

View File

@@ -11,6 +11,7 @@
from __future__ import absolute_import
import json
import atexit
import mimetypes
from multiprocessing.pool import ThreadPool
import os
@@ -79,11 +80,19 @@ class ApiClient(object):
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
def __del__(self):
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
def close(self):
if self._pool:
self._pool.close()
self._pool.join()
self._pool = None
if hasattr(atexit, 'unregister'):
atexit.unregister(self.close)
@property
def pool(self):
@@ -91,6 +100,7 @@ class ApiClient(object):
avoids instantiating unused threadpool for blocking clients.
"""
if self._pool is None:
atexit.register(self.close)
self._pool = ThreadPool(self.pool_threads)
return self._pool
@@ -152,13 +162,14 @@ class ApiClient(object):
collection_formats)
post_params.extend(self.files_parameters(files))
# auth setting
self.update_params_for_auth(header_params, query_params, auth_settings)
# body
if body:
body = self.sanitize_for_serialization(body)
# auth setting
self.update_params_for_auth(header_params, query_params,
auth_settings, resource_path, method, body)
# request url
if _host is None:
url = self.configuration.host + resource_path
@@ -510,12 +521,17 @@ class ApiClient(object):
else:
return content_types[0]
def update_params_for_auth(self, headers, querys, auth_settings):
def update_params_for_auth(self, headers, querys, auth_settings,
resource_path, method, body):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param querys: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
:resource_path: A string representation of the HTTP request resource path.
:method: A string representation of the HTTP request method.
:body: A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization().
"""
if not auth_settings:
return
@@ -526,7 +542,8 @@ class ApiClient(object):
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
elif auth_setting['in'] == 'header':
headers[auth_setting['key']] = auth_setting['value']
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':
querys.append((auth_setting['key'], auth_setting['value']))
else:

View File

@@ -40,6 +40,7 @@ class Configuration(object):
:Example:
API Key Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
@@ -55,11 +56,26 @@ class Configuration(object):
)
The following cookie will be added to the HTTP request:
Cookie: JSESSIONID abc123
HTTP Basic Authentication Example.
Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
http_basic_auth:
type: http
scheme: basic
Configure API client with HTTP basic authentication:
conf = petstore_api.Configuration(
username='the-user',
password='the-password',
)
"""
def __init__(self, host="http://petstore.swagger.io:80/v2",
api_key=None, api_key_prefix=None,
username=None, password=None):
username=None, password=None,
):
"""Constructor
"""
self.host = host
@@ -88,7 +104,7 @@ class Configuration(object):
self.password = password
"""Password for HTTP basic authentication
"""
self.access_token = ""
self.access_token = None
"""access token for OAuth/Bearer
"""
self.logger = {}

View File

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

View File

@@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try:
from petstore_api.models import read_only_first
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):

View File

@@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try:
from petstore_api.models import animal
except ImportError:
animal = sys.modules['petstore_api.models.animal']
animal = sys.modules[
'petstore_api.models.animal']
try:
from petstore_api.models import cat_all_of
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):

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try:
from petstore_api.models import animal
except ImportError:
animal = sys.modules['petstore_api.models.animal']
animal = sys.modules[
'petstore_api.models.animal']
try:
from petstore_api.models import dog_all_of
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):

View File

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

View File

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

View File

@@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401
try:
from petstore_api.models import string_boolean_map
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):

View File

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

View File

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

View File

@@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401
try:
from petstore_api.models import grandparent
except ImportError:
grandparent = sys.modules['petstore_api.models.grandparent']
grandparent = sys.modules[
'petstore_api.models.grandparent']
try:
from petstore_api.models import parent_all_of
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):

View File

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

View File

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

View File

@@ -21,7 +21,12 @@ VERSION = "1.0.0"
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
REQUIRES = [
"urllib3 >= 1.15",
"six >= 1.10",
"certifi",
"python-dateutil",
]
EXTRAS = {':python_version <= "2.7"': ['future']}
setup(

View File

@@ -5,14 +5,19 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
OpenAPI spec version: 1.0.0
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import six
import unittest
if six.PY3:
from unittest.mock import patch
else:
from mock import patch
import petstore_api
from petstore_api.api.fake_api import FakeApi # noqa: E501
@@ -28,6 +33,13 @@ class TestFakeApi(unittest.TestCase):
def tearDown(self):
pass
def test_create_xml_item(self):
"""Test case for create_xml_item
creates an XmlItem # noqa: E501
"""
pass
def test_fake_outer_boolean_serialize(self):
"""Test case for fake_outer_boolean_serialize
@@ -64,6 +76,12 @@ class TestFakeApi(unittest.TestCase):
"""
pass
def test_test_body_with_file_schema(self):
"""Test case for test_body_with_file_schema
"""
pass
def test_test_body_with_query_params(self):
"""Test case for test_body_with_query_params
@@ -77,6 +95,29 @@ class TestFakeApi(unittest.TestCase):
"""
pass
def test_test_endpoint_enums_length_one(self):
"""Test case for test_endpoint_enums_length_one
"""
# when we omit the required enums of length one, they are still set
endpoint = self.api.test_endpoint_enums_length_one
with patch.object(endpoint, 'call_with_http_info') as call_with_http_info:
endpoint()
call_with_http_info.assert_called_with(
_check_input_type=True,
_check_return_type=True,
_host_index=0,
_preload_content=True,
_request_timeout=None,
_return_http_data_only=True,
async_req=False,
header_number=1.234,
path_integer=34,
path_string='hello',
query_integer=3,
query_string='brillig'
)
def test_test_endpoint_parameters(self):
"""Test case for test_endpoint_parameters
@@ -115,6 +156,13 @@ class TestFakeApi(unittest.TestCase):
with self.assertRaises(petstore_api.ApiValueError):
self.api.test_enum_parameters(**keyword_args)
def test_test_group_parameters(self):
"""Test case for test_group_parameters
Fake endpoint to test group parameters (optional) # noqa: E501
"""
pass
def test_test_inline_additional_properties(self):
"""Test case for test_inline_additional_properties

View File

@@ -11,6 +11,8 @@ $ nosetests -v
import os
import time
import atexit
import weakref
import unittest
from dateutil.parser import parse
@@ -44,7 +46,7 @@ class ApiClientTests(unittest.TestCase):
self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key'])
# update parameters based on auth setting
client.update_params_for_auth(header_params, query_params, auth_settings)
client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
# test api key auth
self.assertEqual(header_params['test1'], 'value1')
@@ -59,14 +61,14 @@ class ApiClientTests(unittest.TestCase):
config.api_key['api_key'] = '123456'
config.api_key_prefix['api_key'] = None
# update parameters based on auth setting
client.update_params_for_auth(header_params, query_params, auth_settings)
client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
self.assertEqual(header_params['api_key'], '123456')
# test api key with empty prefix
config.api_key['api_key'] = '123456'
config.api_key_prefix['api_key'] = ''
# update parameters based on auth setting
client.update_params_for_auth(header_params, query_params, auth_settings)
client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
self.assertEqual(header_params['api_key'], '123456')
# test api key with prefix specified in the api_key, useful when the prefix
@@ -74,7 +76,7 @@ class ApiClientTests(unittest.TestCase):
config.api_key['api_key'] = 'PREFIX=123456'
config.api_key_prefix['api_key'] = None
# update parameters based on auth setting
client.update_params_for_auth(header_params, query_params, auth_settings)
client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None)
self.assertEqual(header_params['api_key'], 'PREFIX=123456')
@@ -199,3 +201,17 @@ class ApiClientTests(unittest.TestCase):
model = petstore_api.StringBooleanMap(**model_dict)
result = self.api_client.sanitize_for_serialization(model)
self.assertEqual(result, model_dict)
def test_context_manager_closes_threadpool(self):
with petstore_api.ApiClient() as client:
self.assertIsNotNone(client.pool)
pool_ref = weakref.ref(client._pool)
self.assertIsNotNone(pool_ref())
self.assertIsNone(pool_ref())
def test_atexit_closes_threadpool(self):
client = petstore_api.ApiClient()
self.assertIsNotNone(client.pool)
self.assertIsNotNone(client._pool)
atexit._run_exitfuncs()
self.assertIsNone(client._pool)

View File

@@ -119,21 +119,26 @@ class PetApiTests(unittest.TestCase):
def test_config(self):
config = Configuration(host=HOST)
self.assertIsNotNone(config.get_host_settings())
self.assertEquals(config.get_basic_auth_token(),
self.assertEqual(config.get_basic_auth_token(),
urllib3.util.make_headers(basic_auth=":").get('authorization'))
self.assertEquals(len(config.auth_settings()), 1)
# No authentication scheme has been configured at this point, so auth_settings()
# should return an empty list.
self.assertEqual(len(config.auth_settings()), 0)
# Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters.
config.access_token = 'MY-ACCESS_TOKEN'
self.assertEqual(len(config.auth_settings()), 1)
self.assertIn("petstore_auth", config.auth_settings().keys())
config.username = "user"
config.password = "password"
self.assertEquals(
self.assertEqual(
config.get_basic_auth_token(),
urllib3.util.make_headers(basic_auth="user:password").get('authorization'))
self.assertEquals(len(config.auth_settings()), 2)
self.assertEqual(len(config.auth_settings()), 2)
self.assertIn("petstore_auth", config.auth_settings().keys())
self.assertIn("http_basic_test", config.auth_settings().keys())
config.username = None
config.password = None
self.assertEquals(len(config.auth_settings()), 1)
self.assertEqual(len(config.auth_settings()), 1)
self.assertIn("petstore_auth", config.auth_settings().keys())
def test_timeout(self):
@@ -193,7 +198,7 @@ class PetApiTests(unittest.TestCase):
response = thread.get()
response2 = thread2.get()
self.assertEquals(response.id, self.pet.id)
self.assertEqual(response.id, self.pet.id)
self.assertIsNotNone(response2.id, self.pet.id)
def test_async_with_http_info(self):
@@ -204,7 +209,7 @@ class PetApiTests(unittest.TestCase):
data, status, headers = thread.get()
self.assertIsInstance(data, petstore_api.Pet)
self.assertEquals(status, 200)
self.assertEqual(status, 200)
def test_async_exception(self):
self.pet_api.add_pet(self.pet)