diff --git a/generate/templates/api_doc_example.mustache b/generate/templates/api_doc_example.mustache index a52e932..ee1ca48 100644 --- a/generate/templates/api_doc_example.mustache +++ b/generate/templates/api_doc_example.mustache @@ -1,7 +1,6 @@ ```python from __future__ import print_function import time -import os import {{{packageName}}} from {{{packageName}}}.rest import ApiException {{#vendorExtensions.x-py-example-import}} diff --git a/generate/templates/common_README.mustache b/generate/templates/common_README.mustache index b472cb1..51a06e3 100644 --- a/generate/templates/common_README.mustache +++ b/generate/templates/common_README.mustache @@ -2,7 +2,7 @@ {{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} -from {{{packageName}}}.rest import ApiException +from {{{packageName}}}.exceptions import ApiException from pprint import pprint {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{> python_doc_auth_partial}} @@ -10,7 +10,7 @@ from pprint import pprint # Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use {{#asyncio}}async {{/asyncio}}with api_client_factory: # Create an instance of the API class - api_instance = {{{packageName}}}.{{{classname}}}(api_client) + api_instance = api_client_factory.build({{{classname}}}) {{#allParams}} {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} {{/allParams}} diff --git a/generate/templates/python_doc_auth_partial.mustache b/generate/templates/python_doc_auth_partial.mustache index c6b2eb4..970a850 100644 --- a/generate/templates/python_doc_auth_partial.mustache +++ b/generate/templates/python_doc_auth_partial.mustache @@ -1,9 +1,10 @@ +import os from {{packageName}} import ( - ApiClientFactory, - ApplicationMetadataApi, - EnvironmentVariablesConfigurationLoader, - SecretsFileConfigurationLoader, - ArgsConfigurationLoader + ApiClientFactory, + {{{classname}}}, + EnvironmentVariablesConfigurationLoader, + SecretsFileConfigurationLoader, + ArgsConfigurationLoader ) # Use the {{packageName}} ApiClientFactory to build Api instances with a configured api client