forked from loafle/openapi-generator-original
[python] Renames python generators (#7965)
* python->python-legacy, python-experimental->python * test with openjdk8 * test with openjdk11 * comment out rm * move kotlin tests to circleci * move kotlin tests * move tests to circleci * fix circleci * rearrange test * move tests * use wrapper Co-authored-by: Justin Black <justin.a.black@gmail.com>
This commit is contained in:
@@ -24,10 +24,10 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_api
|
||||
from petstore_api.model.user import User
|
||||
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.
|
||||
@@ -39,13 +39,27 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
user = petstore_api.User() # User | Created user object
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
user = User(
|
||||
id=1,
|
||||
username="username_example",
|
||||
first_name="first_name_example",
|
||||
last_name="last_name_example",
|
||||
email="email_example",
|
||||
password="password_example",
|
||||
phone="phone_example",
|
||||
user_status=1,
|
||||
object_with_no_declared_props={},
|
||||
object_with_no_declared_props_nullable={},
|
||||
any_type_prop=None,
|
||||
any_type_prop_nullable=None,
|
||||
) # User | Created user object
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Create user
|
||||
api_instance.create_user(user)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->create_user: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -53,7 +67,7 @@ with petstore_api.ApiClient() as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -83,10 +97,10 @@ Creates list of users with given input array
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_api
|
||||
from petstore_api.model.user import User
|
||||
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.
|
||||
@@ -98,13 +112,29 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
user = [petstore_api.User()] # list[User] | List of user object
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
user = [
|
||||
User(
|
||||
id=1,
|
||||
username="username_example",
|
||||
first_name="first_name_example",
|
||||
last_name="last_name_example",
|
||||
email="email_example",
|
||||
password="password_example",
|
||||
phone="phone_example",
|
||||
user_status=1,
|
||||
object_with_no_declared_props={},
|
||||
object_with_no_declared_props_nullable={},
|
||||
any_type_prop=None,
|
||||
any_type_prop_nullable=None,
|
||||
),
|
||||
] # [User] | List of user object
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_array_input(user)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -112,7 +142,7 @@ with petstore_api.ApiClient() as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**list[User]**](User.md)| List of user object |
|
||||
**user** | [**[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -142,10 +172,10 @@ Creates list of users with given input array
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_api
|
||||
from petstore_api.model.user import User
|
||||
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.
|
||||
@@ -157,13 +187,29 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
user = [petstore_api.User()] # list[User] | List of user object
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
user = [
|
||||
User(
|
||||
id=1,
|
||||
username="username_example",
|
||||
first_name="first_name_example",
|
||||
last_name="last_name_example",
|
||||
email="email_example",
|
||||
password="password_example",
|
||||
phone="phone_example",
|
||||
user_status=1,
|
||||
object_with_no_declared_props={},
|
||||
object_with_no_declared_props_nullable={},
|
||||
any_type_prop=None,
|
||||
any_type_prop_nullable=None,
|
||||
),
|
||||
] # [User] | List of user object
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_list_input(user)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -171,7 +217,7 @@ with petstore_api.ApiClient() as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**list[User]**](User.md)| List of user object |
|
||||
**user** | [**[User]**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -203,10 +249,9 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_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.
|
||||
@@ -218,13 +263,14 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The name that needs to be deleted
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
username = "username_example" # str | The name that needs to be deleted
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Delete user
|
||||
api_instance.delete_user(username)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->delete_user: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -232,7 +278,7 @@ with petstore_api.ApiClient() as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **str**| The name that needs to be deleted |
|
||||
**username** | **str**| The name that needs to be deleted |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -263,10 +309,10 @@ Get user by user name
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_api
|
||||
from petstore_api.model.user import User
|
||||
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.
|
||||
@@ -278,14 +324,15 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
username = "username_example" # str | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Get user by user name
|
||||
api_response = api_instance.get_user_by_name(username)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -293,7 +340,7 @@ with petstore_api.ApiClient() as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **str**| The name that needs to be fetched. Use user1 for testing. |
|
||||
**username** | **str**| The name that needs to be fetched. Use user1 for testing. |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -325,10 +372,9 @@ Logs user into the system
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_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.
|
||||
@@ -340,15 +386,16 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | The user name for login
|
||||
password = 'password_example' # str | The password for login in clear text
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
username = "username_example" # str | The user name for login
|
||||
password = "password_example" # str | The password for login in clear text
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Logs user into the system
|
||||
api_response = api_instance.login_user(username, password)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->login_user: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -356,8 +403,8 @@ password = 'password_example' # str | The password for login in clear text
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **str**| The user name for login |
|
||||
**password** | **str**| The password for login in clear text |
|
||||
**username** | **str**| The user name for login |
|
||||
**password** | **str**| The password for login in clear text |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -388,10 +435,9 @@ Logs out current logged in user session
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_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.
|
||||
@@ -403,12 +449,13 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
|
||||
# example, this endpoint has no required or optional parameters
|
||||
try:
|
||||
# Logs out current logged in user session
|
||||
api_instance.logout_user()
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->logout_user: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -445,10 +492,10 @@ This can only be done by the logged in user.
|
||||
### Example
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
import petstore_api
|
||||
from petstore_api.rest import ApiException
|
||||
from petstore_api.api import user_api
|
||||
from petstore_api.model.user import User
|
||||
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.
|
||||
@@ -460,14 +507,28 @@ configuration = petstore_api.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with petstore_api.ApiClient() as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = petstore_api.UserApi(api_client)
|
||||
username = 'username_example' # str | name that need to be deleted
|
||||
user = petstore_api.User() # User | Updated user object
|
||||
api_instance = user_api.UserApi(api_client)
|
||||
username = "username_example" # str | name that need to be deleted
|
||||
user = User(
|
||||
id=1,
|
||||
username="username_example",
|
||||
first_name="first_name_example",
|
||||
last_name="last_name_example",
|
||||
email="email_example",
|
||||
password="password_example",
|
||||
phone="phone_example",
|
||||
user_status=1,
|
||||
object_with_no_declared_props={},
|
||||
object_with_no_declared_props_nullable={},
|
||||
any_type_prop=None,
|
||||
any_type_prop_nullable=None,
|
||||
) # User | Updated user object
|
||||
|
||||
# example passing only required values which don't have defaults set
|
||||
try:
|
||||
# Updated user
|
||||
api_instance.update_user(username, user)
|
||||
except ApiException as e:
|
||||
except petstore_api.ApiException as e:
|
||||
print("Exception when calling UserApi->update_user: %s\n" % e)
|
||||
```
|
||||
|
||||
@@ -475,8 +536,8 @@ user = petstore_api.User() # User | Updated user object
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **str**| name that need to be deleted |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
**username** | **str**| name that need to be deleted |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
Reference in New Issue
Block a user