Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTECH-3418: Move import os into doc_auth_partial, so its included in … #10

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion generate/templates/api_doc_example.mustache
Original file line number Diff line number Diff line change
@@ -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}}
Expand Down
4 changes: 2 additions & 2 deletions generate/templates/common_README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{{#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}}

# 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}}
Expand Down
11 changes: 6 additions & 5 deletions generate/templates/python_doc_auth_partial.mustache
Original file line number Diff line number Diff line change
@@ -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
Expand Down