From e744011a7a9e5fc4833b932ee301a00712b693b9 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 24 Apr 2020 09:10:32 -0700 Subject: [PATCH] [Python experimental] Readme improvements (#6031) * Python experimental readme improvements * Python experimental readme improvements * execute scripts in bin directory --- .../resources/python/common_README.mustache | 4 +- .../resources/python/configuration.mustache | 56 +- .../README_common.mustache | 4 +- .../python/python_doc_auth_partial.mustache | 116 ++++- .../client/petstore/python-asyncio/README.md | 10 +- .../python-asyncio/docs/AnotherFakeApi.md | 6 + .../petstore/python-asyncio/docs/FakeApi.md | 99 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../petstore/python-asyncio/docs/PetApi.md | 166 ++++-- .../petstore/python-asyncio/docs/StoreApi.md | 40 +- .../petstore/python-asyncio/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- .../petstore/python-experimental/README.md | 10 +- .../docs/AnotherFakeApi.md | 6 + .../python-experimental/docs/FakeApi.md | 105 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../python-experimental/docs/PetApi.md | 166 ++++-- .../python-experimental/docs/StoreApi.md | 40 +- .../python-experimental/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- .../client/petstore/python-tornado/README.md | 10 +- .../python-tornado/docs/AnotherFakeApi.md | 6 + .../petstore/python-tornado/docs/FakeApi.md | 99 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../petstore/python-tornado/docs/PetApi.md | 166 ++++-- .../petstore/python-tornado/docs/StoreApi.md | 40 +- .../petstore/python-tornado/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- samples/client/petstore/python/README.md | 10 +- .../petstore/python/docs/AnotherFakeApi.md | 6 + .../client/petstore/python/docs/FakeApi.md | 99 +++- .../python/docs/FakeClassnameTags123Api.md | 22 +- samples/client/petstore/python/docs/PetApi.md | 166 ++++-- .../client/petstore/python/docs/StoreApi.md | 40 +- .../client/petstore/python/docs/UserApi.md | 48 ++ .../python/petstore_api/configuration.py | 20 +- .../petstore/python-experimental/README.md | 10 +- .../docs/AnotherFakeApi.md | 6 + .../python-experimental/docs/DefaultApi.md | 6 + .../python-experimental/docs/FakeApi.md | 112 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../python-experimental/docs/PetApi.md | 482 +++++++++++++----- .../python-experimental/docs/StoreApi.md | 40 +- .../python-experimental/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 56 +- .../openapi3/client/petstore/python/README.md | 10 +- .../petstore/python/docs/AnotherFakeApi.md | 6 + .../client/petstore/python/docs/DefaultApi.md | 6 + .../client/petstore/python/docs/FakeApi.md | 112 +++- .../python/docs/FakeClassnameTags123Api.md | 22 +- .../client/petstore/python/docs/PetApi.md | 166 ++++-- .../client/petstore/python/docs/StoreApi.md | 40 +- .../client/petstore/python/docs/UserApi.md | 48 ++ .../python/petstore_api/configuration.py | 20 +- 54 files changed, 2499 insertions(+), 543 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 991002aa17cd..37060d6d1f3d 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -1,13 +1,13 @@ ```python from __future__ import print_function +{{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} from {{{packageName}}}.rest import ApiException from pprint import pprint {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{> python_doc_auth_partial}} -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" + # Enter a context with an instance of the API client with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 7fdcd894277e..dceab63e67b2 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = {{{packageName}}}.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = {{{packageName}}}.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 {{/hasApiKeyMethods}} @@ -80,10 +82,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = {{{packageName}}}.Configuration( - username='the-user', - password='the-password', - ) + +conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', +) + {{/hasHttpBasicMethods}} {{#hasHttpSignatureMethods}} @@ -107,24 +111,24 @@ class Configuration(object): load balancers may add/modify/remove headers. Include the HTTP headers that you know are not going to be modified in transit. - conf = {{{packageName}}}.Configuration( - signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) +conf = {{{packageName}}}.Configuration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_RSASSA_PSS, + signed_headers = [{{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) {{/hasHttpSignatureMethods}} {{/hasAuthMethods}} """ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index b474eb264ae1..7d9811fdfb85 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -1,12 +1,12 @@ ```python from __future__ import print_function +{{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} from pprint import pprint {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{> python_doc_auth_partial}} -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" + # Enter a context with an instance of the API client with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache index d8cfc4ad11df..3086d770b183 100644 --- a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache @@ -1,51 +1,113 @@ +# Defining the host is optional and defaults to {{{basePath}}} +# See configuration.py for a list of all supported configuration parameters. +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}" +) + {{#hasAuthMethods}} +# 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. {{#authMethods}} -configuration = {{{packageName}}}.Configuration() {{#isBasic}} {{#isBasicBasic}} + # Configure HTTP basic authorization: {{{name}}} -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +configuration = {{{packageName}}}.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) {{/isBasicBasic}} {{#isBasicBearer}} + # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} -configuration.access_token = 'YOUR_BEARER_TOKEN' +configuration = {{{packageName}}}.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) {{/isBasicBearer}} {{#isHttpSignature}} -# Configure HTTP signature authorization: {{{name}}} -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) + +# Configure HTTP message signature: {{{name}}} +# 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 {{{packageName}}}.signing for a list of all supported parameters. +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}", + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'private_key.pem', + private_key_passphrase = 'YOUR_PASSPHRASE', + signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019, + signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3, + hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256, + signed_headers = [ + {{{packageName}}}.signing.HEADER_REQUEST_TARGET, + {{{packageName}}}.signing.HEADER_CREATED, + {{{packageName}}}.signing.HEADER_EXPIRES, + {{{packageName}}}.signing.HEADER_HOST, + {{{packageName}}}.signing.HEADER_DATE, + {{{packageName}}}.signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) ) {{/isHttpSignature}} {{/isBasic}} {{#isApiKey}} + # Configure API key authorization: {{{name}}} -configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY' +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}", + api_key = { + '{{{keyParamName}}}': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['{{{keyParamName}}}'] = 'Bearer' {{/isApiKey}} {{#isOAuth}} + # Configure OAuth2 access token for authorization: {{{name}}} +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' {{/isOAuth}} {{/authMethods}} - -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" {{/hasAuthMethods}} diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 36c0a082f3fd..1cfb40e579e7 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md index f777f0d43e6c..047c4ae6444b 100644 --- a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index d1d84afd1ce7..68a36b5f7525 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -35,6 +35,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -90,6 +96,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -145,6 +157,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -200,6 +218,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -255,6 +279,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -310,6 +340,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -362,6 +398,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -418,6 +460,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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. -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -564,6 +621,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -634,6 +697,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -697,6 +766,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -750,6 +825,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -807,6 +888,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md index 160851b5c31c..5e1739a561e5 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md index 5e9f9804ee00..a07c55e726d5 100644 --- a/samples/client/petstore/python-asyncio/docs/PetApi.md +++ b/samples/client/petstore/python-asyncio/docs/PetApi.md @@ -29,13 +29,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -90,13 +100,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -155,13 +175,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -219,13 +249,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -348,13 +400,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -411,13 +473,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -475,13 +547,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -540,13 +622,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md index 360d7e01865e..8d5e2178eaf5 100644 --- a/samples/client/petstore/python-asyncio/docs/StoreApi.md +++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md @@ -25,6 +25,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -142,6 +160,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -198,6 +222,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md index 1d69ee7aa6e3..6cb9d1ec3849 100644 --- a/samples/client/petstore/python-asyncio/docs/UserApi.md +++ b/samples/client/petstore/python-asyncio/docs/UserApi.md @@ -29,6 +29,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,6 +88,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -135,6 +147,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -190,6 +208,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -244,6 +268,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -300,6 +330,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -357,6 +393,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -408,6 +450,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ef96f1bc5cd1..a93073e81424 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -61,10 +61,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -77,10 +79,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index f64e70f79da3..81b680fa57b3 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -46,13 +46,19 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_api 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 493dd47a4cf3..83a89addfaee 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -21,6 +21,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 59b07dd05a0a..de9a3fd1a4fb 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -35,6 +35,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -90,6 +96,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -146,6 +158,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -202,6 +220,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -258,6 +282,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -314,6 +344,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -370,6 +406,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -422,6 +464,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -478,6 +526,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -534,6 +588,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -592,13 +652,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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. + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -689,6 +758,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -760,6 +835,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -831,6 +912,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -884,6 +971,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 1b5308a8199a..c10f9f37e164 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -22,15 +22,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index c7f69f794b5c..d7192a2dd5f3 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -28,13 +28,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -89,13 +99,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -162,13 +182,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -226,13 +256,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -290,15 +330,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -355,13 +407,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -418,13 +480,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -490,13 +562,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -566,13 +648,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index efcc4a3ea287..b4492962d69c 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -24,6 +24,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -81,15 +87,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -141,6 +159,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -197,6 +221,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 4473840b5ce7..b02b92afbf74 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -28,6 +28,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -81,6 +87,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -134,6 +146,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -189,6 +207,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -243,6 +267,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -299,6 +329,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -356,6 +392,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -407,6 +449,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 066665d16fc9..32406df02f53 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 36c0a082f3fd..1cfb40e579e7 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md index f777f0d43e6c..047c4ae6444b 100644 --- a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index d1d84afd1ce7..68a36b5f7525 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -35,6 +35,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -90,6 +96,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -145,6 +157,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -200,6 +218,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -255,6 +279,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -310,6 +340,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -362,6 +398,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -418,6 +460,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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. -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -564,6 +621,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -634,6 +697,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -697,6 +766,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -750,6 +825,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -807,6 +888,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md index 160851b5c31c..5e1739a561e5 100644 --- a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md index 5e9f9804ee00..a07c55e726d5 100644 --- a/samples/client/petstore/python-tornado/docs/PetApi.md +++ b/samples/client/petstore/python-tornado/docs/PetApi.md @@ -29,13 +29,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -90,13 +100,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -155,13 +175,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -219,13 +249,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -348,13 +400,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -411,13 +473,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -475,13 +547,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -540,13 +622,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md index 360d7e01865e..8d5e2178eaf5 100644 --- a/samples/client/petstore/python-tornado/docs/StoreApi.md +++ b/samples/client/petstore/python-tornado/docs/StoreApi.md @@ -25,6 +25,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -142,6 +160,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -198,6 +222,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md index 1d69ee7aa6e3..6cb9d1ec3849 100644 --- a/samples/client/petstore/python-tornado/docs/UserApi.md +++ b/samples/client/petstore/python-tornado/docs/UserApi.md @@ -29,6 +29,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,6 +88,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -135,6 +147,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -190,6 +208,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -244,6 +268,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -300,6 +330,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -357,6 +393,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -408,6 +450,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 066665d16fc9..32406df02f53 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 36c0a082f3fd..1cfb40e579e7 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md index f777f0d43e6c..047c4ae6444b 100644 --- a/samples/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index d1d84afd1ce7..68a36b5f7525 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -35,6 +35,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -90,6 +96,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -145,6 +157,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -200,6 +218,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -255,6 +279,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -310,6 +340,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -362,6 +398,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -418,6 +460,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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. -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -564,6 +621,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -634,6 +697,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -697,6 +766,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -750,6 +825,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -807,6 +888,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md index 160851b5c31c..5e1739a561e5 100644 --- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md index 5e9f9804ee00..a07c55e726d5 100644 --- a/samples/client/petstore/python/docs/PetApi.md +++ b/samples/client/petstore/python/docs/PetApi.md @@ -29,13 +29,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -90,13 +100,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -155,13 +175,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -219,13 +249,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -348,13 +400,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -411,13 +473,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -475,13 +547,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -540,13 +622,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index 360d7e01865e..8d5e2178eaf5 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -25,6 +25,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -142,6 +160,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -198,6 +222,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md index 1d69ee7aa6e3..6cb9d1ec3849 100644 --- a/samples/client/petstore/python/docs/UserApi.md +++ b/samples/client/petstore/python/docs/UserApi.md @@ -29,6 +29,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,6 +88,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -135,6 +147,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -190,6 +208,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -244,6 +268,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -300,6 +330,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -357,6 +393,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -408,6 +450,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 066665d16fc9..32406df02f53 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index a0988878b947..b2158bd96594 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -46,13 +46,19 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function +import datetime import time import petstore_api 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index 831230e18c65..7b8b3d6796d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -21,6 +21,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index 080fe8bd98bb..91623f7a45ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -19,6 +19,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index c1146038a232..a31649db9aaf 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -32,6 +32,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -84,6 +90,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -140,6 +152,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -196,6 +214,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -252,6 +276,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -308,6 +338,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -360,6 +396,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -416,6 +458,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -473,13 +521,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# Defining 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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. + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -570,6 +627,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -642,12 +705,21 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure Bearer authorization (JWT): bearer_test -configuration.access_token = 'YOUR_BEARER_TOKEN' +# Defining 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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. + +# Configure Bearer authorization (JWT): bearer_test +configuration = petstore_api.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -719,6 +791,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -772,6 +850,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -829,6 +913,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index a93336558a92..ab1eb4d62ca8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -22,15 +22,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 72f7fb27fc30..62bcfdd1bdd1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -28,34 +28,83 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() + +# 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. + +# 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) + ) +) + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -109,13 +158,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -181,34 +240,83 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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. + +# 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) + ) ) -configuration = petstore_api.Configuration() + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -266,34 +374,83 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() + +# 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. + +# 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) + ) +) + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -351,15 +508,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -416,34 +585,83 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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. + +# 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) + ) ) -configuration = petstore_api.Configuration() + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -499,13 +717,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -571,13 +799,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -645,13 +883,23 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index 4372edd56540..4a7b890a1cc1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -24,6 +24,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -81,15 +87,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -141,6 +159,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -197,6 +221,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 70c5e1232ac7..4aa31e100bb0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -28,6 +28,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -81,6 +87,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -134,6 +146,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -189,6 +207,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -243,6 +267,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -299,6 +329,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -356,6 +392,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -407,6 +449,12 @@ from __future__ import print_function import time import petstore_api 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index d885572339ef..92c53fb54ec0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -64,10 +64,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -80,10 +82,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + HTTP Signature Authentication Example. Given the following security scheme in the OpenAPI specification: @@ -105,24 +109,24 @@ class Configuration(object): load balancers may add/modify/remove headers. Include the HTTP headers that you know are not going to be modified in transit. - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) +conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = petstore_api.signing.SCHEME_HS2019, + signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS, + 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', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) +) """ _default = None diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 39d427e7cccd..2c3dd373c6e0 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" # 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 diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md index d93ffd79f195..ecd52ad7705d 100644 --- a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/DefaultApi.md index dbb994da49c2..7f022fd7d3eb 100644 --- a/samples/openapi3/client/petstore/python/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python/docs/DefaultApi.md @@ -20,6 +20,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index e1b0e67d4230..2ae2daf4bb8e 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -33,6 +33,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -85,6 +91,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -140,6 +152,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -195,6 +213,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -250,6 +274,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -305,6 +335,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -357,6 +393,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -413,6 +455,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -470,13 +518,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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. + +# Configure HTTP basic authorization: http_basic_test +configuration = petstore_api.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -559,6 +616,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -630,12 +693,21 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure Bearer authorization (JWT): bearer_test -configuration.access_token = 'YOUR_BEARER_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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. + +# Configure Bearer authorization (JWT): bearer_test +configuration = petstore_api.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) # Enter a context with an instance of the API client with petstore_api.ApiClient(configuration) as api_client: @@ -699,6 +771,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -752,6 +830,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -809,6 +893,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md index bf60f00c6a0d..822fd39acec9 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key_query': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index eafac6a400de..d64a86236a79 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -29,13 +29,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -89,13 +99,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -153,13 +173,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -217,13 +247,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -281,15 +321,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -346,13 +398,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -408,13 +470,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -472,13 +544,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -537,13 +619,23 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure OAuth2 access token for authorization: petstore_auth +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md index 9bfe9d95bf77..3e6cc02faa6c 100644 --- a/samples/openapi3/client/petstore/python/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md @@ -25,6 +25,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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. + # Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + api_key = { + 'api_key': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" - # 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 @@ -142,6 +160,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -198,6 +222,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md index 6de550edd989..32a62c8add92 100644 --- a/samples/openapi3/client/petstore/python/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/UserApi.md @@ -29,6 +29,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -82,6 +88,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -135,6 +147,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -190,6 +208,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -244,6 +268,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -300,6 +330,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -357,6 +393,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: @@ -408,6 +450,12 @@ import time 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" +) + # Enter a context with an instance of the API client with petstore_api.ApiClient() as api_client: diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index d0d05b11381f..915a079502fd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None