[python-nextgen] better sample code (#15248)

* better python-nextgen sample code

* remove future import

* fix signing doc

* better test

* use hasHttpBearerMethods instead
This commit is contained in:
William Cheng 2023-04-19 15:55:06 +08:00 committed by GitHub
parent e3fdac0711
commit 0176957e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 325 additions and 880 deletions

View File

@ -414,6 +414,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
* @param pydantic pydantic imports * @param pydantic pydantic imports
* @param datetimeImports datetime imports * @param datetimeImports datetime imports
* @param modelImports model imports * @param modelImports model imports
* @param exampleImports example imports
* @param classname class name * @param classname class name
* @return pydantic type * @return pydantic type
* *
@ -423,6 +424,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
Set<String> pydanticImports, Set<String> pydanticImports,
Set<String> datetimeImports, Set<String> datetimeImports,
Set<String> modelImports, Set<String> modelImports,
Set<String> exampleImports,
String classname) { String classname) {
if (cp == null) { if (cp == null) {
// if codegen parameter (e.g. map/dict of undefined type) is null, default to string // if codegen parameter (e.g. map/dict of undefined type) is null, default to string
@ -444,12 +446,12 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
} }
pydanticImports.add("conlist"); pydanticImports.add("conlist");
return String.format(Locale.ROOT, "conlist(%s%s)", return String.format(Locale.ROOT, "conlist(%s%s)",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname), getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname),
constraints); constraints);
} else if (cp.isMap) { } else if (cp.isMap) {
typingImports.add("Dict"); typingImports.add("Dict");
return String.format(Locale.ROOT, "Dict[str, %s]", return String.format(Locale.ROOT, "Dict[str, %s]",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname)); getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname));
} else if (cp.isString || cp.isBinary || cp.isByteArray) { } else if (cp.isString || cp.isBinary || cp.isByteArray) {
if (cp.hasValidation) { if (cp.hasValidation) {
List<String> fieldCustomization = new ArrayList<>(); List<String> fieldCustomization = new ArrayList<>();
@ -643,6 +645,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
// add model prefix // add model prefix
hasModelsToImport = true; hasModelsToImport = true;
modelImports.add(cp.dataType); modelImports.add(cp.dataType);
exampleImports.add(cp.dataType);
return cp.dataType; return cp.dataType;
} else if (cp.getContent() != null) { } else if (cp.getContent() != null) {
LinkedHashMap<String, CodegenMediaType> contents = cp.getContent(); LinkedHashMap<String, CodegenMediaType> contents = cp.getContent();
@ -650,7 +653,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
CodegenMediaType cmt = contents.get(key); CodegenMediaType cmt = contents.get(key);
// TODO process the first one only at the moment // TODO process the first one only at the moment
if (cmt != null) if (cmt != null)
return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, classname); return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname);
} }
throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp); throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
} else { } else {
@ -666,6 +669,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
* @param pydantic pydantic imports * @param pydantic pydantic imports
* @param datetimeImports datetime imports * @param datetimeImports datetime imports
* @param modelImports model imports * @param modelImports model imports
* @param exampleImports example imports
* @param classname class name * @param classname class name
* @return pydantic type * @return pydantic type
* *
@ -675,6 +679,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
Set<String> pydanticImports, Set<String> pydanticImports,
Set<String> datetimeImports, Set<String> datetimeImports,
Set<String> modelImports, Set<String> modelImports,
Set<String> exampleImports,
String classname) { String classname) {
if (cp == null) { if (cp == null) {
// if codegen property (e.g. map/dict of undefined type) is null, default to string // if codegen property (e.g. map/dict of undefined type) is null, default to string
@ -715,11 +720,11 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
pydanticImports.add("conlist"); pydanticImports.add("conlist");
typingImports.add("List"); // for return type typingImports.add("List"); // for return type
return String.format(Locale.ROOT, "conlist(%s%s)", return String.format(Locale.ROOT, "conlist(%s%s)",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname), getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname),
constraints); constraints);
} else if (cp.isMap) { } else if (cp.isMap) {
typingImports.add("Dict"); typingImports.add("Dict");
return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, classname)); return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname));
} else if (cp.isString) { } else if (cp.isString) {
if (cp.hasValidation) { if (cp.hasValidation) {
List<String> fieldCustomization = new ArrayList<>(); List<String> fieldCustomization = new ArrayList<>();
@ -917,6 +922,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
// for parameter model, import directly // for parameter model, import directly
hasModelsToImport = true; hasModelsToImport = true;
modelImports.add(cp.dataType); modelImports.add(cp.dataType);
exampleImports.add(cp.dataType);
} else { } else {
if (circularImports.containsKey(cp.dataType)) { if (circularImports.containsKey(cp.dataType)) {
if (circularImports.get(cp.dataType).contains(classname)) { if (circularImports.get(cp.dataType).contains(classname)) {
@ -926,6 +932,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
// not circular import, so ok to import it // not circular import, so ok to import it
hasModelsToImport = true; hasModelsToImport = true;
modelImports.add(cp.dataType); modelImports.add(cp.dataType);
exampleImports.add(cp.dataType);
} }
} else { } else {
LOGGER.error("Failed to look up {} from the imports (map of set) of models.", cp.dataType); LOGGER.error("Failed to look up {} from the imports (map of set) of models.", cp.dataType);
@ -948,10 +955,11 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
OperationMap objectMap = objs.getOperations(); OperationMap objectMap = objs.getOperations();
List<CodegenOperation> operations = objectMap.getOperation(); List<CodegenOperation> operations = objectMap.getOperation();
for (CodegenOperation operation : operations) { for (CodegenOperation operation : operations) {
TreeSet<String> exampleImports = new TreeSet<>(); // import for each operation to be show in sample code
List<CodegenParameter> params = operation.allParams; List<CodegenParameter> params = operation.allParams;
for (CodegenParameter param : params) { for (CodegenParameter param : params) {
String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports, null); String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, null);
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
String firstField = ""; String firstField = "";
@ -1003,9 +1011,18 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
// update typing import for operation return type // update typing import for operation return type
if (!StringUtils.isEmpty(operation.returnType)) { if (!StringUtils.isEmpty(operation.returnType)) {
String typing = getPydanticType(operation.returnProperty, typingImports, String typing = getPydanticType(operation.returnProperty, typingImports,
new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, null); new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, exampleImports, null);
} }
// add import for code samples
// import models one by one
if (!exampleImports.isEmpty()) {
List<String> imports = new ArrayList<>();
for (String exampleImport : exampleImports) {
imports.add("from " + packageName + ".models." + underscore(exampleImport) + " import " + exampleImport);
}
operation.vendorExtensions.put("x-py-example-import", imports);
}
} }
List<Map<String, String>> newImports = new ArrayList<>(); List<Map<String, String>> newImports = new ArrayList<>();
@ -1040,21 +1057,6 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
} }
} }
/* TODO
// need models import
if (hasModelsToImport) {
Map<String, String> item = new HashMap<>();
item.put("import", String.format(Locale.ROOT, "from %s import models", packageName));
newImports.add(item);
}
// models import
if (hasModelsToImport) {
Map<String, String> item = new HashMap<>();
item.put("import", String.format(Locale.ROOT, "from %s import %s", modelPackage, StringUtils.join(modelImports, ", ")));
newImports.add(item);
}*/
// reset imports with newImports // reset imports with newImports
objs.setImports(newImports); objs.setImports(newImports);
return objs; return objs;
@ -1185,6 +1187,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
TreeSet<String> modelImports = new TreeSet<>(); TreeSet<String> modelImports = new TreeSet<>();
for (ModelMap m : objs.getModels()) { for (ModelMap m : objs.getModels()) {
TreeSet<String> exampleImports = new TreeSet<>();
List<String> readOnlyFields = new ArrayList<>(); List<String> readOnlyFields = new ArrayList<>();
hasModelsToImport = false; hasModelsToImport = false;
int property_count = 1; int property_count = 1;
@ -1229,7 +1232,7 @@ public class PythonNextgenClientCodegen extends AbstractPythonCodegen implements
//loop through properties/schemas to set up typing, pydantic //loop through properties/schemas to set up typing, pydantic
for (CodegenProperty cp : codegenProperties) { for (CodegenProperty cp : codegenProperties) {
String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, model.classname); String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, model.classname);
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
String firstField = ""; String firstField = "";

View File

@ -18,6 +18,10 @@ from {{packageName}}.exceptions import ApiValueError
from {{packageName}}.exceptions import ApiKeyError from {{packageName}}.exceptions import ApiKeyError
from {{packageName}}.exceptions import ApiAttributeError from {{packageName}}.exceptions import ApiAttributeError
from {{packageName}}.exceptions import ApiException from {{packageName}}.exceptions import ApiException
{{#hasHttpSignatureMethods}}
from {{packageName}}.signing import HttpSigningConfiguration
{{/hasHttpSignatureMethods}}
# import models into sdk package # import models into sdk package
{{#models}} {{#models}}
{{#model}} {{#model}}

View File

@ -35,12 +35,10 @@ Method | HTTP request | Description
{{#isOAuth}} {{#isOAuth}}
* OAuth Authentication ({{name}}): * OAuth Authentication ({{name}}):
{{/isOAuth }} {{/isOAuth }}
{{> api_doc_example }}
{{/authMethods}} {{/authMethods}}
{{/hasAuthMethods}} {{/hasAuthMethods}}
{{^hasAuthMethods}}
{{> api_doc_example }} {{> api_doc_example }}
{{/hasAuthMethods}}
### Parameters ### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -1,10 +1,13 @@
```python ```python
from __future__ import print_function
import time import time
import os import os
import {{{packageName}}} import {{{packageName}}}
{{#vendorExtensions.x-py-example-import}}
{{{.}}}
{{/vendorExtensions.x-py-example-import}}
from {{{packageName}}}.rest import ApiException from {{{packageName}}}.rest import ApiException
from pprint import pprint from pprint import pprint
{{> python_doc_auth_partial}} {{> python_doc_auth_partial}}
# Enter a context with an instance of the API client # Enter a context with an instance of the API client
{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: {{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client:

View File

@ -64,9 +64,12 @@ configuration = {{{packageName}}}.Configuration(
# the API server. # the API server.
# #
# See {{{packageName}}}.signing for a list of all supported parameters. # See {{{packageName}}}.signing for a list of all supported parameters.
from {{{packageName}}} import signing
import datetime
configuration = {{{packageName}}}.Configuration( configuration = {{{packageName}}}.Configuration(
host = "{{{basePath}}}", host = "{{{basePath}}}",
signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( signing_info = {{{packageName}}}.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',

View File

@ -19,12 +19,12 @@ Test binary (gif) response body
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -46,6 +46,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling BodyApi->test_binary_gif: %s\n" % e) print("Exception when calling BodyApi->test_binary_gif: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -79,12 +80,13 @@ Test body parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -107,6 +109,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling BodyApi->test_echo_body_pet: %s\n" % e) print("Exception when calling BodyApi->test_echo_body_pet: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -143,12 +146,13 @@ Test empty response body
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -171,6 +175,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling BodyApi->test_echo_body_pet_response_string: %s\n" % e) print("Exception when calling BodyApi->test_echo_body_pet_response_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -17,12 +17,12 @@ Test form parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -47,6 +47,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling FormApi->test_form_integer_boolean_string: %s\n" % e) print("Exception when calling FormApi->test_form_integer_boolean_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -17,12 +17,12 @@ Test header parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -47,6 +47,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling HeaderApi->test_header_integer_boolean_string: %s\n" % e) print("Exception when calling HeaderApi->test_header_integer_boolean_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -17,12 +17,12 @@ Test path parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -46,6 +46,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling PathApi->tests_path_string_path_string_integer_path_integer: %s\n" % e) print("Exception when calling PathApi->tests_path_string_path_string_integer_path_integer: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -23,12 +23,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -53,6 +53,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_datetime_date_string: %s\n" % e) print("Exception when calling QueryApi->test_query_datetime_date_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -91,12 +92,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -121,6 +122,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_integer_boolean_string: %s\n" % e) print("Exception when calling QueryApi->test_query_integer_boolean_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -159,12 +161,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -187,6 +189,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_style_deep_object_explode_true_object: %s\n" % e) print("Exception when calling QueryApi->test_query_style_deep_object_explode_true_object: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -223,12 +226,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -251,6 +254,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_style_deep_object_explode_true_object_all_of: %s\n" % e) print("Exception when calling QueryApi->test_query_style_deep_object_explode_true_object_all_of: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -287,12 +291,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -315,6 +319,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_style_form_explode_true_array_string: %s\n" % e) print("Exception when calling QueryApi->test_query_style_form_explode_true_array_string: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -351,12 +356,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -379,6 +384,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_style_form_explode_true_object: %s\n" % e) print("Exception when calling QueryApi->test_query_style_form_explode_true_object: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -415,12 +421,12 @@ Test query parameter(s)
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000 # Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration( configuration = openapi_client.Configuration(
@ -443,6 +449,7 @@ with openapi_client.ApiClient(configuration) as api_client:
print("Exception when calling QueryApi->test_query_style_form_explode_true_object_all_of: %s\n" % e) print("Exception when calling QueryApi->test_query_style_form_explode_true_object_all_of: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -33,6 +33,7 @@ from openapi_client.exceptions import ApiValueError
from openapi_client.exceptions import ApiKeyError from openapi_client.exceptions import ApiKeyError
from openapi_client.exceptions import ApiAttributeError from openapi_client.exceptions import ApiAttributeError
from openapi_client.exceptions import ApiException from openapi_client.exceptions import ApiException
# import models into sdk package # import models into sdk package
from openapi_client.models.bird import Bird from openapi_client.models.bird import Bird
from openapi_client.models.category import Category from openapi_client.models.category import Category

View File

@ -31,6 +31,7 @@ class TestManual(unittest.TestCase):
def testDateTimeQueryWithDateTimeFormat(self): def testDateTimeQueryWithDateTimeFormat(self):
api_instance = openapi_client.QueryApi() api_instance = openapi_client.QueryApi()
datetime_format_backup = api_instance.api_client.configuration.datetime_format # backup dateime_format
api_instance.api_client.configuration.datetime_format = "%Y-%m-%d %a %H:%M:%S%Z" api_instance.api_client.configuration.datetime_format = "%Y-%m-%d %a %H:%M:%S%Z"
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional) datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)
date_query = '2013-10-20' # date | (optional) date_query = '2013-10-20' # date | (optional)
@ -41,6 +42,9 @@ class TestManual(unittest.TestCase):
e = EchoServerResponseParser(api_response) e = EchoServerResponseParser(api_response)
self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20%20Sun%2019%3A20%3A30UTC-05%3A00&date_query=2013-10-20&string_query=string_query_example") self.assertEqual(e.path, "/query/datetime/date/string?datetime_query=2013-10-20%20Sun%2019%3A20%3A30UTC-05%3A00&date_query=2013-10-20&string_query=string_query_example")
# restore datetime format
api_instance.api_client.configuration.datetime_format = datetime_format_backup
def testDateTimeQueryWithDateTime(self): def testDateTimeQueryWithDateTime(self):
api_instance = openapi_client.QueryApi() api_instance = openapi_client.QueryApi()
datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional) datetime_query = datetime.datetime.fromisoformat('2013-10-20T19:20:30-05:00') # datetime | (optional)

View File

@ -17,12 +17,13 @@ To test special tags and operation ID starting with number
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -45,6 +46,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -15,12 +15,13 @@ Method | HTTP request | Description
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -41,6 +42,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling DefaultApi->foo_get: %s\n" % e) print("Exception when calling DefaultApi->foo_get: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.

View File

@ -32,12 +32,12 @@ test any type request body
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -58,6 +58,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -92,12 +93,13 @@ Health check endpoint
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.health_check_result import HealthCheckResult
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -119,6 +121,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_health_get: %s\n" % e) print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -150,12 +153,13 @@ test http signature authentication
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -203,9 +207,12 @@ configuration = petstore_api.Configuration(
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -242,6 +249,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e) print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -280,12 +288,12 @@ Test serialization of outer boolean types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -307,6 +315,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -343,12 +352,13 @@ Test serialization of object with outer number type
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.outer_composite import OuterComposite
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -370,6 +380,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -406,12 +417,12 @@ Test serialization of outer number types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -433,6 +444,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -469,12 +481,12 @@ Test serialization of outer string types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -496,6 +508,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -532,12 +545,13 @@ Test serialization of enum (int) properties with examples
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -559,6 +573,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -595,12 +610,12 @@ For this test, the body has to be a binary file.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -620,6 +635,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e) print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -656,12 +672,13 @@ For this test, the body for this request must reference a schema named `File`.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -681,6 +698,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -715,12 +733,13 @@ No authorization required
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -741,6 +760,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -778,12 +798,13 @@ To test \"client\" model
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -806,6 +827,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_client_model: %s\n" % e) print("Exception when calling FakeApi->test_client_model: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -840,12 +862,12 @@ No authorization required
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -866,6 +888,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e) print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -904,12 +927,12 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* Basic Authentication (http_basic_test): * Basic Authentication (http_basic_test):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -953,6 +976,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1004,12 +1028,12 @@ Fake endpoint to test group parameters (optional)
* Bearer (JWT) Authentication (bearer_test): * Bearer (JWT) Authentication (bearer_test):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1044,6 +1068,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1085,12 +1110,12 @@ test inline additionalProperties
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1111,6 +1136,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1147,12 +1173,12 @@ test json serialization of form data
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1174,6 +1200,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1211,12 +1238,12 @@ To test the collection format in query parameters
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1242,6 +1269,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -18,12 +18,13 @@ To test class name in snake case
* Api Key Authentication (api_key_query): * Api Key Authentication (api_key_query):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -56,6 +57,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -26,12 +26,13 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -81,9 +82,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -118,98 +122,6 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->add_pet: %s\n" % e) print("Exception when calling PetApi->add_pet: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Enter a context with an instance of the API client
async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try:
# Add a new pet to the store
await api_instance.add_pet(pet)
except Exception as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
### Parameters ### Parameters
@ -249,12 +161,12 @@ Deletes a pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -282,6 +194,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->delete_pet: %s\n" % e) print("Exception when calling PetApi->delete_pet: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -321,12 +234,13 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -376,9 +290,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -415,100 +332,6 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Enter a context with an instance of the API client
async 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'] # List[str] | Status values that need to be considered for filter
try:
# Finds Pets by status
api_response = await api_instance.find_pets_by_status(status)
print("The response of PetApi->find_pets_by_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
### Parameters ### Parameters
@ -548,12 +371,13 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -603,9 +427,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -642,100 +469,6 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Enter a context with an instance of the API client
async 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'] # List[str] | Tags to filter by
try:
# Finds Pets by tags
api_response = await api_instance.find_pets_by_tags(tags)
print("The response of PetApi->find_pets_by_tags:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
### Parameters ### Parameters
@ -775,12 +508,13 @@ Returns a single pet
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -813,6 +547,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -852,12 +587,13 @@ Update an existing pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -907,9 +643,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -944,98 +683,6 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->update_pet: %s\n" % e) print("Exception when calling PetApi->update_pet: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# Enter a context with an instance of the API client
async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.PetApi(api_client)
pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try:
# Update an existing pet
await api_instance.update_pet(pet)
except Exception as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
### Parameters ### Parameters
@ -1077,12 +724,12 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1111,6 +758,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1151,12 +799,13 @@ uploads an image
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1187,6 +836,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->upload_file: %s\n" % e) print("Exception when calling PetApi->upload_file: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1226,12 +876,13 @@ uploads an image (required)
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1262,6 +913,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -20,12 +20,12 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -46,6 +46,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->delete_order: %s\n" % e) print("Exception when calling StoreApi->delete_order: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -84,12 +85,12 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -121,6 +122,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->get_inventory: %s\n" % e) print("Exception when calling StoreApi->get_inventory: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -154,12 +156,13 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -182,6 +185,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -220,12 +224,13 @@ Place an order for a pet
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -248,6 +253,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->place_order: %s\n" % e) print("Exception when calling StoreApi->place_order: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -24,12 +24,13 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -50,6 +51,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_user: %s\n" % e) print("Exception when calling UserApi->create_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -86,12 +88,13 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -112,6 +115,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -148,12 +152,13 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -174,6 +179,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -210,12 +216,12 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -236,6 +242,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->delete_user: %s\n" % e) print("Exception when calling UserApi->delete_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -273,12 +280,13 @@ Get user by user name
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -301,6 +309,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e) print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -339,12 +348,12 @@ Logs user into the system
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -368,6 +377,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->login_user: %s\n" % e) print("Exception when calling UserApi->login_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -406,12 +416,12 @@ Logs out current logged in user session
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -431,6 +441,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->logout_user: %s\n" % e) print("Exception when calling UserApi->logout_user: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -464,12 +475,13 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -491,6 +503,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->update_user: %s\n" % e) print("Exception when calling UserApi->update_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -34,6 +34,8 @@ from petstore_api.exceptions import ApiValueError
from petstore_api.exceptions import ApiKeyError from petstore_api.exceptions import ApiKeyError
from petstore_api.exceptions import ApiAttributeError from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiException from petstore_api.exceptions import ApiException
from petstore_api.signing import HttpSigningConfiguration
# import models into sdk package # import models into sdk package
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef

View File

@ -17,12 +17,13 @@ To test special tags and operation ID starting with number
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -45,6 +46,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -15,12 +15,13 @@ Method | HTTP request | Description
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -41,6 +42,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling DefaultApi->foo_get: %s\n" % e) print("Exception when calling DefaultApi->foo_get: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.

View File

@ -32,12 +32,12 @@ test any type request body
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -58,6 +58,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e) print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -92,12 +93,13 @@ Health check endpoint
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.health_check_result import HealthCheckResult
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -119,6 +121,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_health_get: %s\n" % e) print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -150,12 +153,13 @@ test http signature authentication
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -203,9 +207,12 @@ configuration = petstore_api.Configuration(
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -242,6 +249,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e) print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -280,12 +288,12 @@ Test serialization of outer boolean types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -307,6 +315,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -343,12 +352,13 @@ Test serialization of object with outer number type
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.outer_composite import OuterComposite
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -370,6 +380,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -406,12 +417,12 @@ Test serialization of outer number types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -433,6 +444,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -469,12 +481,12 @@ Test serialization of outer string types
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -496,6 +508,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -532,12 +545,13 @@ Test serialization of enum (int) properties with examples
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -559,6 +573,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e) print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -595,12 +610,12 @@ For this test, the body has to be a binary file.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -620,6 +635,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e) print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -656,12 +672,13 @@ For this test, the body for this request must reference a schema named `File`.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -681,6 +698,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -715,12 +733,13 @@ No authorization required
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -741,6 +760,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -778,12 +798,13 @@ To test \"client\" model
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -806,6 +827,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_client_model: %s\n" % e) print("Exception when calling FakeApi->test_client_model: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -840,12 +862,12 @@ No authorization required
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -866,6 +888,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e) print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -904,12 +927,12 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* Basic Authentication (http_basic_test): * Basic Authentication (http_basic_test):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -953,6 +976,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1004,12 +1028,12 @@ Fake endpoint to test group parameters (optional)
* Bearer (JWT) Authentication (bearer_test): * Bearer (JWT) Authentication (bearer_test):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1044,6 +1068,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1085,12 +1110,12 @@ test inline additionalProperties
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1111,6 +1136,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1147,12 +1173,12 @@ test json serialization of form data
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1174,6 +1200,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1211,12 +1238,12 @@ To test the collection format in query parameters
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1242,6 +1269,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -18,12 +18,13 @@ To test class name in snake case
* Api Key Authentication (api_key_query): * Api Key Authentication (api_key_query):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -56,6 +57,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -26,12 +26,13 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -81,9 +82,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -118,98 +122,6 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->add_pet: %s\n" % e) print("Exception when calling PetApi->add_pet: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# 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 = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try:
# Add a new pet to the store
api_instance.add_pet(pet)
except Exception as e:
print("Exception when calling PetApi->add_pet: %s\n" % e)
```
### Parameters ### Parameters
@ -249,12 +161,12 @@ Deletes a pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -282,6 +194,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->delete_pet: %s\n" % e) print("Exception when calling PetApi->delete_pet: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -321,12 +234,13 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -376,9 +290,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -415,100 +332,6 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# 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'] # List[str] | Status values that need to be considered for filter
try:
# Finds Pets by status
api_response = api_instance.find_pets_by_status(status)
print("The response of PetApi->find_pets_by_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
```
### Parameters ### Parameters
@ -548,12 +371,13 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -603,9 +427,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -642,100 +469,6 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# 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'] # List[str] | Tags to filter by
try:
# Finds Pets by tags
api_response = api_instance.find_pets_by_tags(tags)
print("The response of PetApi->find_pets_by_tags:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
```
### Parameters ### Parameters
@ -775,12 +508,13 @@ Returns a single pet
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -813,6 +547,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -852,12 +587,13 @@ Update an existing pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -907,9 +643,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
# the API server. # the API server.
# #
# See petstore_api.signing for a list of all supported parameters. # See petstore_api.signing for a list of all supported parameters.
from petstore_api import signing
import datetime
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2", host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration( signing_info = petstore_api.HttpSigningConfiguration(
key_id = 'my-key-id', key_id = 'my-key-id',
private_key_path = 'private_key.pem', private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE', private_key_passphrase = 'YOUR_PASSPHRASE',
@ -944,98 +683,6 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->update_pet: %s\n" % e) print("Exception when calling PetApi->update_pet: %s\n" % e)
``` ```
```python
from __future__ import print_function
import time
import os
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Configure HTTP message signature: http_signature_test
# The HTTP Signature Header mechanism that can be used by a client to
# authenticate the sender of a message and ensure that particular headers
# have not been modified in transit.
#
# You can specify the signing key-id, private key path, signing scheme,
# signing algorithm, list of signed headers and signature max validity.
# The 'key_id' parameter is an opaque string that the API server can use
# to lookup the client and validate the signature.
# The 'private_key_path' parameter should be the path to a file that
# contains a DER or base-64 encoded private key.
# The 'private_key_passphrase' parameter is optional. Set the passphrase
# if the private key is encrypted.
# The 'signed_headers' parameter is used to specify the list of
# HTTP headers included when generating the signature for the message.
# You can specify HTTP headers that you want to protect with a cryptographic
# signature. Note that proxies may add, modify or remove HTTP headers
# for legitimate reasons, so you should only add headers that you know
# will not be modified. For example, if you want to protect the HTTP request
# body, you can specify the Digest header. In that case, the client calculates
# the digest of the HTTP request body and includes the digest in the message
# signature.
# The 'signature_max_validity' parameter is optional. It is configured as a
# duration to express when the signature ceases to be valid. The client calculates
# the expiration date every time it generates the cryptographic signature
# of an HTTP request. The API server may have its own security policy
# that controls the maximum validity of the signature. The client max validity
# must be lower than the server max validity.
# The time on the client and server must be synchronized, otherwise the
# server may reject the client signature.
#
# The client must use a combination of private key, signing scheme,
# signing algorithm and hash algorithm that matches the security policy of
# the API server.
#
# See petstore_api.signing for a list of all supported parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2",
signing_info = petstore_api.signing.HttpSigningConfiguration(
key_id = 'my-key-id',
private_key_path = 'private_key.pem',
private_key_passphrase = 'YOUR_PASSPHRASE',
signing_scheme = petstore_api.signing.SCHEME_HS2019,
signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
signed_headers = [
petstore_api.signing.HEADER_REQUEST_TARGET,
petstore_api.signing.HEADER_CREATED,
petstore_api.signing.HEADER_EXPIRES,
petstore_api.signing.HEADER_HOST,
petstore_api.signing.HEADER_DATE,
petstore_api.signing.HEADER_DIGEST,
'Content-Type',
'Content-Length',
'User-Agent'
],
signature_max_validity = datetime.timedelta(minutes=5)
)
)
# 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 = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
try:
# Update an existing pet
api_instance.update_pet(pet)
except Exception as e:
print("Exception when calling PetApi->update_pet: %s\n" % e)
```
### Parameters ### Parameters
@ -1077,12 +724,12 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1111,6 +758,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1151,12 +799,13 @@ uploads an image
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1187,6 +836,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->upload_file: %s\n" % e) print("Exception when calling PetApi->upload_file: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -1226,12 +876,13 @@ uploads an image (required)
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -1262,6 +913,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -20,12 +20,12 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -46,6 +46,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->delete_order: %s\n" % e) print("Exception when calling StoreApi->delete_order: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -84,12 +85,12 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -121,6 +122,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->get_inventory: %s\n" % e) print("Exception when calling StoreApi->get_inventory: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -154,12 +156,13 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -182,6 +185,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -220,12 +224,13 @@ Place an order for a pet
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -248,6 +253,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling StoreApi->place_order: %s\n" % e) print("Exception when calling StoreApi->place_order: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -24,12 +24,13 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -50,6 +51,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_user: %s\n" % e) print("Exception when calling UserApi->create_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -86,12 +88,13 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -112,6 +115,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -148,12 +152,13 @@ Creates list of users with given input array
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -174,6 +179,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -210,12 +216,12 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -236,6 +242,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->delete_user: %s\n" % e) print("Exception when calling UserApi->delete_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -273,12 +280,13 @@ Get user by user name
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -301,6 +309,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->get_user_by_name: %s\n" % e) print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -339,12 +348,12 @@ Logs user into the system
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -368,6 +377,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->login_user: %s\n" % e) print("Exception when calling UserApi->login_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes
@ -406,12 +416,12 @@ Logs out current logged in user session
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -431,6 +441,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->logout_user: %s\n" % e) print("Exception when calling UserApi->logout_user: %s\n" % e)
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter. This endpoint does not need any parameter.
@ -464,12 +475,13 @@ This can only be done by the logged in user.
### Example ### Example
```python ```python
from __future__ import print_function
import time import time
import os import os
import petstore_api import petstore_api
from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters. # See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration( configuration = petstore_api.Configuration(
@ -491,6 +503,7 @@ with petstore_api.ApiClient(configuration) as api_client:
print("Exception when calling UserApi->update_user: %s\n" % e) print("Exception when calling UserApi->update_user: %s\n" % e)
``` ```
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Description | Notes

View File

@ -34,6 +34,8 @@ from petstore_api.exceptions import ApiValueError
from petstore_api.exceptions import ApiKeyError from petstore_api.exceptions import ApiKeyError
from petstore_api.exceptions import ApiAttributeError from petstore_api.exceptions import ApiAttributeError
from petstore_api.exceptions import ApiException from petstore_api.exceptions import ApiException
from petstore_api.signing import HttpSigningConfiguration
# import models into sdk package # import models into sdk package
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef