diff --git a/.gitignore b/.gitignore index 6d9cf37..04139a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# if the openapi spec gets copied in +openapi.yaml + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/docs/AccountRecovery.md b/docs/AccountRecovery.md index 2b57639..3cadd94 100644 --- a/docs/AccountRecovery.md +++ b/docs/AccountRecovery.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | The user's e-mail address | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.account_recovery import AccountRecovery + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountRecovery from a JSON string +account_recovery_instance = AccountRecovery.from_json(json) +# print the JSON string representation of the object +print(AccountRecovery.to_json()) + +# convert the object into a dict +account_recovery_dict = account_recovery_instance.to_dict() +# create an instance of AccountRecovery from a dict +account_recovery_from_dict = AccountRecovery.from_dict(account_recovery_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountRegistration.md b/docs/AccountRegistration.md index 0ffcfb4..e7215da 100644 --- a/docs/AccountRegistration.md +++ b/docs/AccountRegistration.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | The user's e-mail address | **password** | **str** | The user's password | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.account_registration import AccountRegistration + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountRegistration from a JSON string +account_registration_instance = AccountRegistration.from_json(json) +# print the JSON string representation of the object +print(AccountRegistration.to_json()) + +# convert the object into a dict +account_registration_dict = account_registration_instance.to_dict() +# create an instance of AccountRegistration from a dict +account_registration_from_dict = AccountRegistration.from_dict(account_registration_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AccountReset.md b/docs/AccountReset.md index 9fa4435..7bb53b8 100644 --- a/docs/AccountReset.md +++ b/docs/AccountReset.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **activation_code** | **str** | The activation code generated by Ibutsu | **password** | **str** | The user's password | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.account_reset import AccountReset + +# TODO update the JSON string below +json = "{}" +# create an instance of AccountReset from a JSON string +account_reset_instance = AccountReset.from_json(json) +# print the JSON string representation of the object +print(AccountReset.to_json()) + +# convert the object into a dict +account_reset_dict = account_reset_instance.to_dict() +# create an instance of AccountReset from a dict +account_reset_from_dict = AccountReset.from_dict(account_reset_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AdminProjectManagementApi.md b/docs/AdminProjectManagementApi.md index 814fb9b..4e8c3a2 100644 --- a/docs/AdminProjectManagementApi.md +++ b/docs/AdminProjectManagementApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **admin_add_project** -> Project admin_add_project() +> Project admin_add_project(project=project) Administration endpoint to manually add a project. Only accessible to superadmins. @@ -21,11 +21,11 @@ Administration endpoint to manually add a project. Only accessible to superadmin * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_project_management_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,37 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_project_management_api.AdminProjectManagementApi(api_client) - project = Project( - id="44941c55-9736-42f6-acce-ca3c4739d0f3", - name="my-project", - title="My project", - owner_id="6b8b01ad-a17e-4ca1-8df5-fadb41439567", - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # Project | A project (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.AdminProjectManagementApi(api_client) + project = ibutsu_client.Project() # Project | A project object (optional) + try: # Administration endpoint to manually add a project. Only accessible to superadmins. api_response = api_instance.admin_add_project(project=project) + print("The response of AdminProjectManagementApi->admin_add_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminProjectManagementApi->admin_add_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project** | [**Project**](Project.md)| A project | [optional] + **project** | [**Project**](Project.md)| A project object | [optional] ### Return type @@ -84,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -106,10 +100,10 @@ Administration endpoint to delete a project. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_project_management_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -123,29 +117,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_project_management_api.AdminProjectManagementApi(api_client) - id = "id_example" # str | The ID of the project to delete + api_instance = ibutsu_client.AdminProjectManagementApi(api_client) + id = 'id_example' # str | The ID of the project to delete - # example passing only required values which don't have defaults set try: # Administration endpoint to delete a project. Only accessible to superadmins. api_instance.admin_delete_project(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminProjectManagementApi->admin_delete_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the project to delete | + **id** | **str**| The ID of the project to delete | ### Return type @@ -160,7 +155,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -182,11 +176,11 @@ Administration endpoint to return a project. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_project_management_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -200,30 +194,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_project_management_api.AdminProjectManagementApi(api_client) - id = "id_example" # str | The id of a project + api_instance = ibutsu_client.AdminProjectManagementApi(api_client) + id = 'id_example' # str | The id of a project - # example passing only required values which don't have defaults set try: # Administration endpoint to return a project. Only accessible to superadmins. api_response = api_instance.admin_get_project(id) + print("The response of AdminProjectManagementApi->admin_get_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminProjectManagementApi->admin_get_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The id of a project | + **id** | **str**| The id of a project | ### Return type @@ -238,7 +234,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -251,7 +246,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **admin_get_project_list** -> ProjectList admin_get_project_list() +> ProjectList admin_get_project_list(filter=filter, page=page, page_size=page_size) Administration endpoint to return a list of projects. Only accessible to superadmins. @@ -260,11 +255,11 @@ Administration endpoint to return a list of projects. Only accessible to superad * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_project_management_api -from ibutsu_client.model.project_list import ProjectList +from ibutsu_client.models.project_list import ProjectList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -278,37 +273,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_project_management_api.AdminProjectManagementApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.AdminProjectManagementApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Administration endpoint to return a list of projects. Only accessible to superadmins. api_response = api_instance.admin_get_project_list(filter=filter, page=page, page_size=page_size) + print("The response of AdminProjectManagementApi->admin_get_project_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminProjectManagementApi->admin_get_project_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -323,7 +317,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -335,7 +328,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **admin_update_project** -> Project admin_update_project(id) +> Project admin_update_project(id, project=project) Administration endpoint to update a project. Only accessible to superadmins. @@ -344,11 +337,11 @@ Administration endpoint to update a project. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_project_management_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -362,47 +355,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_project_management_api.AdminProjectManagementApi(api_client) - id = "id_example" # str | The ID of the project to update - project = Project( - id="44941c55-9736-42f6-acce-ca3c4739d0f3", - name="my-project", - title="My project", - owner_id="6b8b01ad-a17e-4ca1-8df5-fadb41439567", - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # Project | (optional) - - # example passing only required values which don't have defaults set - try: - # Administration endpoint to update a project. Only accessible to superadmins. - api_response = api_instance.admin_update_project(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling AdminProjectManagementApi->admin_update_project: %s\n" % e) + api_instance = ibutsu_client.AdminProjectManagementApi(api_client) + id = 'id_example' # str | The ID of the project to update + project = ibutsu_client.Project() # Project | A project object (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Administration endpoint to update a project. Only accessible to superadmins. api_response = api_instance.admin_update_project(id, project=project) + print("The response of AdminProjectManagementApi->admin_update_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminProjectManagementApi->admin_update_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the project to update | - **project** | [**Project**](Project.md)| | [optional] + **id** | **str**| The ID of the project to update | + **project** | [**Project**](Project.md)| A project object | [optional] ### Return type @@ -417,7 +397,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/AdminUserManagementApi.md b/docs/AdminUserManagementApi.md index 2522a11..def20cc 100644 --- a/docs/AdminUserManagementApi.md +++ b/docs/AdminUserManagementApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **admin_add_user** -> User admin_add_user() +> User admin_add_user(user=user) Administration endpoint to manually add a user. Only accessible to superadmins. @@ -21,11 +21,11 @@ Administration endpoint to manually add a user. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_user_management_api -from ibutsu_client.model.user import User +from ibutsu_client.models.user import User +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,38 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_user_management_api.AdminUserManagementApi(api_client) - user = User( - id="81e2c9d6-1593-4559-af4f-90f6f1f8fa03", - email="user@domain.com", - name="Namey McNameface", - is_superadmin=False, - is_active=True, - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # User | A user (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.AdminUserManagementApi(api_client) + user = ibutsu_client.User() # User | A user object (optional) + try: # Administration endpoint to manually add a user. Only accessible to superadmins. api_response = api_instance.admin_add_user(user=user) + print("The response of AdminUserManagementApi->admin_add_user:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminUserManagementApi->admin_add_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| A user | [optional] + **user** | [**User**](User.md)| A user object | [optional] ### Return type @@ -85,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -107,10 +100,10 @@ Administration endpoint to delete a user. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_user_management_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -124,29 +117,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_user_management_api.AdminUserManagementApi(api_client) - id = "id_example" # str | The ID of the user to delete + api_instance = ibutsu_client.AdminUserManagementApi(api_client) + id = 'id_example' # str | The ID of the user to delete - # example passing only required values which don't have defaults set try: # Administration endpoint to delete a user. Only accessible to superadmins. api_instance.admin_delete_user(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminUserManagementApi->admin_delete_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the user to delete | + **id** | **str**| The ID of the user to delete | ### Return type @@ -161,7 +155,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -183,11 +176,11 @@ Administration endpoint to return a user. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_user_management_api -from ibutsu_client.model.user import User +from ibutsu_client.models.user import User +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -201,30 +194,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_user_management_api.AdminUserManagementApi(api_client) - id = "id_example" # str | The id of a user + api_instance = ibutsu_client.AdminUserManagementApi(api_client) + id = 'id_example' # str | The id of a user - # example passing only required values which don't have defaults set try: # Administration endpoint to return a user. Only accessible to superadmins. api_response = api_instance.admin_get_user(id) + print("The response of AdminUserManagementApi->admin_get_user:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminUserManagementApi->admin_get_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The id of a user | + **id** | **str**| The id of a user | ### Return type @@ -239,7 +234,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -252,7 +246,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **admin_get_user_list** -> UserList admin_get_user_list() +> UserList admin_get_user_list(filter=filter, page=page, page_size=page_size) Administration endpoint to return a list of users. Only accessible to superadmins. @@ -261,11 +255,11 @@ Administration endpoint to return a list of users. Only accessible to superadmin * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_user_management_api -from ibutsu_client.model.user_list import UserList +from ibutsu_client.models.user_list import UserList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -279,37 +273,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_user_management_api.AdminUserManagementApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.AdminUserManagementApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Administration endpoint to return a list of users. Only accessible to superadmins. api_response = api_instance.admin_get_user_list(filter=filter, page=page, page_size=page_size) + print("The response of AdminUserManagementApi->admin_get_user_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminUserManagementApi->admin_get_user_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -324,7 +317,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -336,7 +328,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **admin_update_user** -> User admin_update_user(id) +> User admin_update_user(id, user=user) Administration endpoint to update a user. Only accessible to superadmins. @@ -345,11 +337,11 @@ Administration endpoint to update a user. Only accessible to superadmins. * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import admin_user_management_api -from ibutsu_client.model.user import User +from ibutsu_client.models.user import User +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -363,48 +355,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = admin_user_management_api.AdminUserManagementApi(api_client) - id = "id_example" # str | The ID of the user to update - user = User( - id="81e2c9d6-1593-4559-af4f-90f6f1f8fa03", - email="user@domain.com", - name="Namey McNameface", - is_superadmin=False, - is_active=True, - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # User | (optional) - - # example passing only required values which don't have defaults set - try: - # Administration endpoint to update a user. Only accessible to superadmins. - api_response = api_instance.admin_update_user(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling AdminUserManagementApi->admin_update_user: %s\n" % e) + api_instance = ibutsu_client.AdminUserManagementApi(api_client) + id = 'id_example' # str | The ID of the user to update + user = ibutsu_client.User() # User | A user object (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Administration endpoint to update a user. Only accessible to superadmins. api_response = api_instance.admin_update_user(id, user=user) + print("The response of AdminUserManagementApi->admin_update_user:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling AdminUserManagementApi->admin_update_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the user to update | - **user** | [**User**](User.md)| | [optional] + **id** | **str**| The ID of the user to update | + **user** | [**User**](User.md)| A user object | [optional] ### Return type @@ -419,7 +397,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/Artifact.md b/docs/Artifact.md index 7f3ac0b..3636d85 100644 --- a/docs/Artifact.md +++ b/docs/Artifact.md @@ -2,16 +2,33 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the artifact | [optional] **result_id** | **str** | ID of test result to attach artifact to | [optional] **run_id** | **str** | ID of test run to attach artifact to | [optional] -**filename** | **str** | ID of pet to update | [optional] -**additional_metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Additional data to pass to server | [optional] +**filename** | **str** | name of the file | [optional] +**additional_metadata** | **object** | Additional data to pass to server | [optional] **upload_date** | **str** | The date this artifact was uploaded | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.artifact import Artifact + +# TODO update the JSON string below +json = "{}" +# create an instance of Artifact from a JSON string +artifact_instance = Artifact.from_json(json) +# print the JSON string representation of the object +print(Artifact.to_json()) + +# convert the object into a dict +artifact_dict = artifact_instance.to_dict() +# create an instance of Artifact from a dict +artifact_from_dict = Artifact.from_dict(artifact_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ArtifactApi.md b/docs/ArtifactApi.md index e3ed159..9cc3ff9 100644 --- a/docs/ArtifactApi.md +++ b/docs/ArtifactApi.md @@ -22,10 +22,10 @@ Delete an artifact * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,29 +39,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - id = "id_example" # str | ID of artifact to delete + api_instance = ibutsu_client.ArtifactApi(api_client) + id = 'id_example' # str | ID of artifact to delete - # example passing only required values which don't have defaults set try: # Delete an artifact api_instance.delete_artifact(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->delete_artifact: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of artifact to delete | + **id** | **str**| ID of artifact to delete | ### Return type @@ -76,7 +77,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -87,7 +87,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **download_artifact** -> file_type download_artifact(id) +> bytearray download_artifact(id) Download an artifact @@ -96,10 +96,10 @@ Download an artifact * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -113,34 +113,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - id = "id_example" # str | ID of artifact to return + api_instance = ibutsu_client.ArtifactApi(api_client) + id = 'id_example' # str | ID of artifact to return - # example passing only required values which don't have defaults set try: # Download an artifact api_response = api_instance.download_artifact(id) + print("The response of ArtifactApi->download_artifact:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->download_artifact: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of artifact to return | + **id** | **str**| ID of artifact to return | ### Return type -**file_type** +**bytearray** ### Authorization @@ -151,7 +153,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: text/plain, image/jpeg, image/png, image/gif, application/octet-stream - ### HTTP response details | Status code | Description | Response headers | @@ -171,11 +172,11 @@ Get a single artifact * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api -from ibutsu_client.model.artifact import Artifact +from ibutsu_client.models.artifact import Artifact +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -189,30 +190,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - id = "id_example" # str | ID of artifact to return + api_instance = ibutsu_client.ArtifactApi(api_client) + id = 'id_example' # str | ID of artifact to return - # example passing only required values which don't have defaults set try: # Get a single artifact api_response = api_instance.get_artifact(id) + print("The response of ArtifactApi->get_artifact:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->get_artifact: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of artifact to return | + **id** | **str**| ID of artifact to return | ### Return type @@ -227,7 +230,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -238,7 +240,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_artifact_list** -> ArtifactList get_artifact_list() +> ArtifactList get_artifact_list(result_id=result_id, run_id=run_id, page=page, page_size=page_size) Get a (filtered) list of artifacts @@ -247,11 +249,11 @@ Get a (filtered) list of artifacts * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api -from ibutsu_client.model.artifact_list import ArtifactList +from ibutsu_client.models.artifact_list import ArtifactList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -265,37 +267,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - result_id = "resultId_example" # str | The result ID to filter by (optional) - run_id = "runId_example" # str | The run ID to filter by (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.ArtifactApi(api_client) + result_id = 'result_id_example' # str | The result ID to filter by (optional) + run_id = 'run_id_example' # str | The run ID to filter by (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Get a (filtered) list of artifacts api_response = api_instance.get_artifact_list(result_id=result_id, run_id=run_id, page=page, page_size=page_size) + print("The response of ArtifactApi->get_artifact_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->get_artifact_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **result_id** | **str**| The result ID to filter by | [optional] - **run_id** | **str**| The run ID to filter by | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **result_id** | **str**| The result ID to filter by | [optional] + **run_id** | **str**| The run ID to filter by | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -310,7 +313,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -320,7 +322,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_artifact** -> Artifact upload_artifact(filename, file) +> Artifact upload_artifact(filename, file, result_id=result_id, run_id=run_id, additional_metadata=additional_metadata) Uploads a test run artifact @@ -329,11 +331,11 @@ Uploads a test run artifact * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api -from ibutsu_client.model.artifact import Artifact +from ibutsu_client.models.artifact import Artifact +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -347,47 +349,40 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - filename = "filename_example" # str | ID of pet to update - file = open('/path/to/file', 'rb') # file_type | file to upload - result_id = "result_id_example" # str | ID of result to attach artifact to (optional) - run_id = "run_id_example" # str | ID of run to attach artifact to (optional) - additional_metadata = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | Additional data to pass to server (optional) - - # example passing only required values which don't have defaults set - try: - # Uploads a test run artifact - api_response = api_instance.upload_artifact(filename, file) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling ArtifactApi->upload_artifact: %s\n" % e) + api_instance = ibutsu_client.ArtifactApi(api_client) + filename = 'filename_example' # str | name of the file + file = None # bytearray | file to upload + result_id = 'result_id_example' # str | ID of result to attach artifact to (optional) + run_id = 'run_id_example' # str | ID of run to attach artifact to (optional) + additional_metadata = None # object | Additional data to pass to server (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Uploads a test run artifact api_response = api_instance.upload_artifact(filename, file, result_id=result_id, run_id=run_id, additional_metadata=additional_metadata) + print("The response of ArtifactApi->upload_artifact:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->upload_artifact: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filename** | **str**| ID of pet to update | - **file** | **file_type**| file to upload | - **result_id** | **str**| ID of result to attach artifact to | [optional] - **run_id** | **str**| ID of run to attach artifact to | [optional] - **additional_metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| Additional data to pass to server | [optional] + **filename** | **str**| name of the file | + **file** | **bytearray**| file to upload | + **result_id** | **str**| ID of result to attach artifact to | [optional] + **run_id** | **str**| ID of run to attach artifact to | [optional] + **additional_metadata** | [**object**](object.md)| Additional data to pass to server | [optional] ### Return type @@ -402,7 +397,6 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -413,7 +407,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **view_artifact** -> file_type view_artifact(id) +> bytearray view_artifact(id) Stream an artifact directly to the client/browser @@ -422,10 +416,10 @@ Stream an artifact directly to the client/browser * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import artifact_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -439,34 +433,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = artifact_api.ArtifactApi(api_client) - id = "id_example" # str | ID of artifact to return + api_instance = ibutsu_client.ArtifactApi(api_client) + id = 'id_example' # str | ID of artifact to return - # example passing only required values which don't have defaults set try: # Stream an artifact directly to the client/browser api_response = api_instance.view_artifact(id) + print("The response of ArtifactApi->view_artifact:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ArtifactApi->view_artifact: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of artifact to return | + **id** | **str**| ID of artifact to return | ### Return type -**file_type** +**bytearray** ### Authorization @@ -477,7 +473,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: text/plain, image/jpeg, image/png, image/gif, application/octet-stream - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ArtifactList.md b/docs/ArtifactList.md index 1c9f293..a38efc7 100644 --- a/docs/ArtifactList.md +++ b/docs/ArtifactList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**artifacts** | [**[Artifact]**](Artifact.md) | | [optional] +**artifacts** | [**List[Artifact]**](Artifact.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.artifact_list import ArtifactList + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactList from a JSON string +artifact_list_instance = ArtifactList.from_json(json) +# print the JSON string representation of the object +print(ArtifactList.to_json()) + +# convert the object into a dict +artifact_list_dict = artifact_list_instance.to_dict() +# create an instance of ArtifactList from a dict +artifact_list_from_dict = ArtifactList.from_dict(artifact_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateToken.md b/docs/CreateToken.md index 028a128..a2689e2 100644 --- a/docs/CreateToken.md +++ b/docs/CreateToken.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name given to this token | -**expires** | **str, none_type** | The date and time when this token expires | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**expires** | **str** | The date and time when this token expires | + +## Example + +```python +from ibutsu_client.models.create_token import CreateToken + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateToken from a JSON string +create_token_instance = CreateToken.from_json(json) +# print the JSON string representation of the object +print(CreateToken.to_json()) +# convert the object into a dict +create_token_dict = create_token_instance.to_dict() +# create an instance of CreateToken from a dict +create_token_from_dict = CreateToken.from_dict(create_token_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Credentials.md b/docs/Credentials.md index ce9dbf8..a7c7280 100644 --- a/docs/Credentials.md +++ b/docs/Credentials.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **str** | The e-mail address of the user | **password** | **str** | The password for the user | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.credentials import Credentials + +# TODO update the JSON string below +json = "{}" +# create an instance of Credentials from a JSON string +credentials_instance = Credentials.from_json(json) +# print the JSON string representation of the object +print(Credentials.to_json()) + +# convert the object into a dict +credentials_dict = credentials_instance.to_dict() +# create an instance of Credentials from a dict +credentials_from_dict = Credentials.from_dict(credentials_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Dashboard.md b/docs/Dashboard.md index 49ad653..a7dcf26 100644 --- a/docs/Dashboard.md +++ b/docs/Dashboard.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the dashboard | [optional] @@ -10,8 +11,24 @@ Name | Type | Description | Notes **filters** | **str** | An optional set of filters | [optional] **project_id** | **str** | The ID of the project this dashboard is associated with | [optional] **user_id** | **str** | The ID of a user this dashboard might be associated with | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.dashboard import Dashboard + +# TODO update the JSON string below +json = "{}" +# create an instance of Dashboard from a JSON string +dashboard_instance = Dashboard.from_json(json) +# print the JSON string representation of the object +print(Dashboard.to_json()) + +# convert the object into a dict +dashboard_dict = dashboard_instance.to_dict() +# create an instance of Dashboard from a dict +dashboard_from_dict = Dashboard.from_dict(dashboard_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DashboardApi.md b/docs/DashboardApi.md index 383d837..f62c376 100644 --- a/docs/DashboardApi.md +++ b/docs/DashboardApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **add_dashboard** -> Dashboard add_dashboard(dashboard) +> Dashboard add_dashboard(dashboard=dashboard) Create a dashboard @@ -21,11 +21,11 @@ Create a dashboard * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import dashboard_api -from ibutsu_client.model.dashboard import Dashboard +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,37 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = dashboard_api.DashboardApi(api_client) - dashboard = Dashboard( - id="62faa4ce-d264-46c2-813e-579949c8ab9b", - title="My Dashboard", - description="A dashboard for me", - filters="", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - user_id="90be2a4a-1a4d-4779-b40f-f08ccd7101d5", - ) # Dashboard | Dashboard - - # example passing only required values which don't have defaults set + api_instance = ibutsu_client.DashboardApi(api_client) + dashboard = ibutsu_client.Dashboard() # Dashboard | A dashboard object (optional) + try: # Create a dashboard - api_response = api_instance.add_dashboard(dashboard) + api_response = api_instance.add_dashboard(dashboard=dashboard) + print("The response of DashboardApi->add_dashboard:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling DashboardApi->add_dashboard: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **dashboard** | [**Dashboard**](Dashboard.md)| Dashboard | + **dashboard** | [**Dashboard**](Dashboard.md)| A dashboard object | [optional] ### Return type @@ -84,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -104,10 +98,10 @@ Delete a dashboard * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import dashboard_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -121,29 +115,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = dashboard_api.DashboardApi(api_client) - id = "id_example" # str | ID of dashboard to delete + api_instance = ibutsu_client.DashboardApi(api_client) + id = 'id_example' # str | ID of dashboard to delete - # example passing only required values which don't have defaults set try: # Delete a dashboard api_instance.delete_dashboard(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling DashboardApi->delete_dashboard: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of dashboard to delete | + **id** | **str**| ID of dashboard to delete | ### Return type @@ -158,7 +153,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -178,11 +172,11 @@ Get a single dashboard by ID * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import dashboard_api -from ibutsu_client.model.dashboard import Dashboard +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -196,30 +190,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = dashboard_api.DashboardApi(api_client) - id = "id_example" # str | ID of test dashboard + api_instance = ibutsu_client.DashboardApi(api_client) + id = 'id_example' # str | ID of test dashboard - # example passing only required values which don't have defaults set try: # Get a single dashboard by ID api_response = api_instance.get_dashboard(id) + print("The response of DashboardApi->get_dashboard:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling DashboardApi->get_dashboard: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of test dashboard | + **id** | **str**| ID of test dashboard | ### Return type @@ -234,7 +230,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -245,7 +240,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_dashboard_list** -> DashboardList get_dashboard_list() +> DashboardList get_dashboard_list(filter=filter, project_id=project_id, user_id=user_id, page=page, page_size=page_size) Get a list of dashboards @@ -254,11 +249,11 @@ Get a list of dashboards * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import dashboard_api -from ibutsu_client.model.dashboard_list import DashboardList +from ibutsu_client.models.dashboard_list import DashboardList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -272,41 +267,40 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = dashboard_api.DashboardApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - project_id = "project_id_example" # str | Filter dashboards by project ID (optional) - user_id = "user_id_example" # str | Filter dashboards by user ID (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.DashboardApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + project_id = 'project_id_example' # str | Filter dashboards by project ID (optional) + user_id = 'user_id_example' # str | Filter dashboards by user ID (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Get a list of dashboards api_response = api_instance.get_dashboard_list(filter=filter, project_id=project_id, user_id=user_id, page=page, page_size=page_size) + print("The response of DashboardApi->get_dashboard_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling DashboardApi->get_dashboard_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **project_id** | **str**| Filter dashboards by project ID | [optional] - **user_id** | **str**| Filter dashboards by user ID | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **project_id** | **str**| Filter dashboards by project ID | [optional] + **user_id** | **str**| Filter dashboards by user ID | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -321,7 +315,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -331,7 +324,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_dashboard** -> Dashboard update_dashboard(id) +> Dashboard update_dashboard(id, dashboard=dashboard) Update a dashboard @@ -340,11 +333,11 @@ Update a dashboard * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import dashboard_api -from ibutsu_client.model.dashboard import Dashboard +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -358,48 +351,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = dashboard_api.DashboardApi(api_client) - id = "id_example" # str | ID of test dashboard - dashboard = Dashboard( - id="62faa4ce-d264-46c2-813e-579949c8ab9b", - title="My Dashboard", - description="A dashboard for me", - filters="", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - user_id="90be2a4a-1a4d-4779-b40f-f08ccd7101d5", - ) # Dashboard | Dashboard (optional) - - # example passing only required values which don't have defaults set - try: - # Update a dashboard - api_response = api_instance.update_dashboard(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling DashboardApi->update_dashboard: %s\n" % e) + api_instance = ibutsu_client.DashboardApi(api_client) + id = 'id_example' # str | ID of test dashboard + dashboard = ibutsu_client.Dashboard() # Dashboard | A dashboard object (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update a dashboard api_response = api_instance.update_dashboard(id, dashboard=dashboard) + print("The response of DashboardApi->update_dashboard:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling DashboardApi->update_dashboard: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of test dashboard | - **dashboard** | [**Dashboard**](Dashboard.md)| Dashboard | [optional] + **id** | **str**| ID of test dashboard | + **dashboard** | [**Dashboard**](Dashboard.md)| A dashboard object | [optional] ### Return type @@ -414,7 +393,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/DashboardList.md b/docs/DashboardList.md index c57b3f5..7740845 100644 --- a/docs/DashboardList.md +++ b/docs/DashboardList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**dashboards** | [**[Dashboard]**](Dashboard.md) | | [optional] +**dashboards** | [**List[Dashboard]**](Dashboard.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.dashboard_list import DashboardList + +# TODO update the JSON string below +json = "{}" +# create an instance of DashboardList from a JSON string +dashboard_list_instance = DashboardList.from_json(json) +# print the JSON string representation of the object +print(DashboardList.to_json()) + +# convert the object into a dict +dashboard_list_dict = dashboard_list_instance.to_dict() +# create an instance of DashboardList from a dict +dashboard_list_from_dict = DashboardList.from_dict(dashboard_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GetReportTypes200ResponseInner.md b/docs/GetReportTypes200ResponseInner.md index 1423209..5abd3d6 100644 --- a/docs/GetReportTypes200ResponseInner.md +++ b/docs/GetReportTypes200ResponseInner.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | The machine-readable name of report type | [optional] **name** | **str** | The human-readable name of report type | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner + +# TODO update the JSON string below +json = "{}" +# create an instance of GetReportTypes200ResponseInner from a JSON string +get_report_types200_response_inner_instance = GetReportTypes200ResponseInner.from_json(json) +# print the JSON string representation of the object +print(GetReportTypes200ResponseInner.to_json()) + +# convert the object into a dict +get_report_types200_response_inner_dict = get_report_types200_response_inner_instance.to_dict() +# create an instance of GetReportTypes200ResponseInner from a dict +get_report_types200_response_inner_from_dict = GetReportTypes200ResponseInner.from_dict(get_report_types200_response_inner_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Group.md b/docs/Group.md index 6d1c11c..5524d6a 100644 --- a/docs/Group.md +++ b/docs/Group.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the group | [optional] **name** | **str** | The name of the group | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.group import Group + +# TODO update the JSON string below +json = "{}" +# create an instance of Group from a JSON string +group_instance = Group.from_json(json) +# print the JSON string representation of the object +print(Group.to_json()) + +# convert the object into a dict +group_dict = group_instance.to_dict() +# create an instance of Group from a dict +group_from_dict = Group.from_dict(group_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GroupApi.md b/docs/GroupApi.md index 8664c12..c2408a7 100644 --- a/docs/GroupApi.md +++ b/docs/GroupApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description # **add_group** -> Group add_group(group) +> Group add_group(group=group) Create a new group @@ -20,11 +20,11 @@ Create a new group * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import group_api -from ibutsu_client.model.group import Group +from ibutsu_client.models.group import Group +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -38,33 +38,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = group_api.GroupApi(api_client) - group = Group( - id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - name="Group A", - ) # Group | The group + api_instance = ibutsu_client.GroupApi(api_client) + group = ibutsu_client.Group() # Group | A group object (optional) - # example passing only required values which don't have defaults set try: # Create a new group - api_response = api_instance.add_group(group) + api_response = api_instance.add_group(group=group) + print("The response of GroupApi->add_group:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling GroupApi->add_group: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **group** | [**Group**](Group.md)| The group | + **group** | [**Group**](Group.md)| A group object | [optional] ### Return type @@ -79,7 +78,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -99,11 +97,11 @@ Get a group * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import group_api -from ibutsu_client.model.group import Group +from ibutsu_client.models.group import Group +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -117,30 +115,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = group_api.GroupApi(api_client) - id = "id_example" # str | The ID of the group + api_instance = ibutsu_client.GroupApi(api_client) + id = 'id_example' # str | The ID of the group - # example passing only required values which don't have defaults set try: # Get a group api_response = api_instance.get_group(id) + print("The response of GroupApi->get_group:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling GroupApi->get_group: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the group | + **id** | **str**| The ID of the group | ### Return type @@ -155,7 +155,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -166,7 +165,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_group_list** -> GroupList get_group_list() +> GroupList get_group_list(page=page, page_size=page_size) Get a list of groups @@ -175,11 +174,11 @@ Get a list of groups * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import group_api -from ibutsu_client.model.group_list import GroupList +from ibutsu_client.models.group_list import GroupList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -193,33 +192,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = group_api.GroupApi(api_client) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) + api_instance = ibutsu_client.GroupApi(api_client) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get a list of groups api_response = api_instance.get_group_list(page=page, page_size=page_size) + print("The response of GroupApi->get_group_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling GroupApi->get_group_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -234,7 +234,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -244,7 +243,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_group** -> Group update_group(id, group) +> Group update_group(id, group=group) Update a group @@ -253,11 +252,11 @@ Update a group * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import group_api -from ibutsu_client.model.group import Group +from ibutsu_client.models.group import Group +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -271,35 +270,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = group_api.GroupApi(api_client) - id = "id_example" # str | The ID of the group - group = Group( - id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - name="Group A", - ) # Group | The updated group - - # example passing only required values which don't have defaults set + api_instance = ibutsu_client.GroupApi(api_client) + id = 'id_example' # str | The ID of the group + group = ibutsu_client.Group() # Group | A group object (optional) + try: # Update a group - api_response = api_instance.update_group(id, group) + api_response = api_instance.update_group(id, group=group) + print("The response of GroupApi->update_group:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling GroupApi->update_group: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the group | - **group** | [**Group**](Group.md)| The updated group | + **id** | **str**| The ID of the group | + **group** | [**Group**](Group.md)| A group object | [optional] ### Return type @@ -314,7 +312,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/GroupList.md b/docs/GroupList.md index 6297bd0..c6b82eb 100644 --- a/docs/GroupList.md +++ b/docs/GroupList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**groups** | [**[Group]**](Group.md) | | [optional] +**groups** | [**List[Group]**](Group.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.group_list import GroupList + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupList from a JSON string +group_list_instance = GroupList.from_json(json) +# print the JSON string representation of the object +print(GroupList.to_json()) + +# convert the object into a dict +group_list_dict = group_list_instance.to_dict() +# create an instance of GroupList from a dict +group_list_from_dict = GroupList.from_dict(group_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Health.md b/docs/Health.md index 415d90f..7230c03 100644 --- a/docs/Health.md +++ b/docs/Health.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **str** | The status of the database, one of \"OK\", \"Error\", \"Pending\" | [optional] **message** | **str** | A message to explain the current status | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.health import Health + +# TODO update the JSON string below +json = "{}" +# create an instance of Health from a JSON string +health_instance = Health.from_json(json) +# print the JSON string representation of the object +print(Health.to_json()) + +# convert the object into a dict +health_dict = health_instance.to_dict() +# create an instance of Health from a dict +health_from_dict = Health.from_dict(health_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/HealthApi.md b/docs/HealthApi.md index a2d49dc..de4d9d6 100644 --- a/docs/HealthApi.md +++ b/docs/HealthApi.md @@ -19,11 +19,11 @@ Get a health report for the database * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import health_api -from ibutsu_client.model.health import Health +from ibutsu_client.models.health import Health +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -37,25 +37,27 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = health_api.HealthApi(api_client) + api_instance = ibutsu_client.HealthApi(api_client) - # example, this endpoint has no required or optional parameters try: # Get a health report for the database api_response = api_instance.get_database_health() + print("The response of HealthApi->get_database_health:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling HealthApi->get_database_health: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -71,7 +73,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -88,46 +89,38 @@ Get a general health report ### Example -* Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import health_api -from ibutsu_client.model.health import Health +from ibutsu_client.models.health import Health +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( host = "/api" ) -# 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): jwt -configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' -) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = health_api.HealthApi(api_client) + api_instance = ibutsu_client.HealthApi(api_client) - # example, this endpoint has no required or optional parameters try: # Get a general health report api_response = api_instance.get_health() + print("The response of HealthApi->get_health:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling HealthApi->get_health: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -136,14 +129,13 @@ This endpoint does not need any parameter. ### Authorization -[jwt](../README.md#jwt) +No authorization required ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -162,11 +154,11 @@ Get information about the server * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import health_api -from ibutsu_client.model.health_info import HealthInfo +from ibutsu_client.models.health_info import HealthInfo +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -180,25 +172,27 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = health_api.HealthApi(api_client) + api_instance = ibutsu_client.HealthApi(api_client) - # example, this endpoint has no required or optional parameters try: # Get information about the server api_response = api_instance.get_health_info() + print("The response of HealthApi->get_health_info:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling HealthApi->get_health_info: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -214,7 +208,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/HealthInfo.md b/docs/HealthInfo.md index af5b775..32d20c1 100644 --- a/docs/HealthInfo.md +++ b/docs/HealthInfo.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **frontend** | **str** | The URL of the frontend | [optional] **backend** | **str** | The URL of the backend | [optional] **api_ui** | **str** | The URL to the UI for the API | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.health_info import HealthInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of HealthInfo from a JSON string +health_info_instance = HealthInfo.from_json(json) +# print the JSON string representation of the object +print(HealthInfo.to_json()) + +# convert the object into a dict +health_info_dict = health_info_instance.to_dict() +# create an instance of HealthInfo from a dict +health_info_from_dict = HealthInfo.from_dict(health_info_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ImportApi.md b/docs/ImportApi.md index a2c9228..1b980ea 100644 --- a/docs/ImportApi.md +++ b/docs/ImportApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **add_import** -> ModelImport add_import(import_file) +> ModelImport add_import(import_file, project=project, metadata=metadata, source=source) Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive @@ -18,11 +18,11 @@ Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu arc * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import import_api -from ibutsu_client.model.model_import import ModelImport +from ibutsu_client.models.model_import import ModelImport +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -36,45 +36,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = import_api.ImportApi(api_client) - import_file = open('/path/to/file', 'rb') # file_type | The file to import - project = "project_example" # str | The project associated with this import (optional) - metadata = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | Additional metadata about imported run (optional) - source = "source_example" # str | The source of this import (optional) + api_instance = ibutsu_client.ImportApi(api_client) + import_file = None # bytearray | The file to import + project = 'project_example' # str | The project associated with this import (optional) + metadata = None # object | Additional metadata about imported run (optional) + source = 'source_example' # str | The source of this import (optional) - # example passing only required values which don't have defaults set - try: - # Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive - api_response = api_instance.add_import(import_file) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling ImportApi->add_import: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive api_response = api_instance.add_import(import_file, project=project, metadata=metadata, source=source) + print("The response of ImportApi->add_import:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ImportApi->add_import: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **import_file** | **file_type**| The file to import | - **project** | **str**| The project associated with this import | [optional] - **metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| Additional metadata about imported run | [optional] - **source** | **str**| The source of this import | [optional] + **import_file** | **bytearray**| The file to import | + **project** | **str**| The project associated with this import | [optional] + **metadata** | [**object**](object.md)| Additional metadata about imported run | [optional] + **source** | **str**| The source of this import | [optional] ### Return type @@ -89,7 +82,6 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -110,11 +102,11 @@ Get the status of an import * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import import_api -from ibutsu_client.model.model_import import ModelImport +from ibutsu_client.models.model_import import ModelImport +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -128,30 +120,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = import_api.ImportApi(api_client) - id = "id_example" # str | The ID of the import + api_instance = ibutsu_client.ImportApi(api_client) + id = 'id_example' # str | The ID of the import - # example passing only required values which don't have defaults set try: # Get the status of an import api_response = api_instance.get_import(id) + print("The response of ImportApi->get_import:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ImportApi->get_import: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the import | + **id** | **str**| The ID of the import | ### Return type @@ -166,7 +160,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/LoginApi.md b/docs/LoginApi.md index 95827e9..4f73c7b 100644 --- a/docs/LoginApi.md +++ b/docs/LoginApi.md @@ -17,16 +17,14 @@ Method | HTTP request | Description # **activate** > activate(activation_code) - - ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -35,24 +33,25 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - activation_code = "activation_code_example" # str | The activation code + api_instance = ibutsu_client.LoginApi(api_client) + activation_code = 'activation_code_example' # str | The activation code - # example passing only required values which don't have defaults set try: api_instance.activate(activation_code) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->activate: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **activation_code** | **str**| The activation code | + **activation_code** | **str**| The activation code | ### Return type @@ -67,7 +66,6 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -80,16 +78,14 @@ No authorization required # **auth** > auth(provider) - - ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -98,24 +94,25 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - provider = "provider_example" # str | The login provider's configuration + api_instance = ibutsu_client.LoginApi(api_client) + provider = 'provider_example' # str | The login provider's configuration - # example passing only required values which don't have defaults set try: api_instance.auth(provider) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->auth: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **provider** | **str**| The login provider's configuration | + **provider** | **str**| The login provider's configuration | ### Return type @@ -130,7 +127,6 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -142,17 +138,15 @@ No authorization required # **config** > LoginConfig config(provider) - - ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.login_config import LoginConfig +from ibutsu_client.models.login_config import LoginConfig +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -161,25 +155,27 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - provider = "provider_example" # str | The login provider's configuration + api_instance = ibutsu_client.LoginApi(api_client) + provider = 'provider_example' # str | The login provider's configuration - # example passing only required values which don't have defaults set try: api_response = api_instance.config(provider) + print("The response of LoginApi->config:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->config: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **provider** | **str**| The login provider's configuration | + **provider** | **str**| The login provider's configuration | ### Return type @@ -194,7 +190,6 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -204,21 +199,18 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **login** -> LoginToken login() - - +> LoginToken login(credentials=credentials) ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.login_token import LoginToken -from ibutsu_client.model.login_error import LoginError -from ibutsu_client.model.credentials import Credentials +from ibutsu_client.models.credentials import Credentials +from ibutsu_client.models.login_token import LoginToken +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -227,29 +219,27 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - credentials = Credentials( - email="me@example.com", - password="mysupersecretpassword", - ) # Credentials | A login object (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.LoginApi(api_client) + credentials = ibutsu_client.Credentials() # Credentials | A login object (optional) + try: api_response = api_instance.login(credentials=credentials) + print("The response of LoginApi->login:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->login: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **credentials** | [**Credentials**](Credentials.md)| A login object | [optional] + **credentials** | [**Credentials**](Credentials.md)| A login object | [optional] ### Return type @@ -264,7 +254,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -275,19 +264,17 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **recover** -> recover() - - +> recover(account_recovery=account_recovery) ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.account_recovery import AccountRecovery +from ibutsu_client.models.account_recovery import AccountRecovery +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -296,27 +283,25 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - account_recovery = AccountRecovery( - email="user@domain.com", - ) # AccountRecovery | A user recovering their password (optional) + api_instance = ibutsu_client.LoginApi(api_client) + account_recovery = ibutsu_client.AccountRecovery() # AccountRecovery | A user recovering their password (optional) - # example passing only required values which don't have defaults set - # and optional values try: api_instance.recover(account_recovery=account_recovery) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->recover: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_recovery** | [**AccountRecovery**](AccountRecovery.md)| A user recovering their password | [optional] + **account_recovery** | [**AccountRecovery**](AccountRecovery.md)| A user recovering their password | [optional] ### Return type @@ -331,7 +316,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -342,20 +326,17 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **register** -> register() - - +> register(account_registration=account_registration) ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.login_error import LoginError -from ibutsu_client.model.account_registration import AccountRegistration +from ibutsu_client.models.account_registration import AccountRegistration +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -364,28 +345,25 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - account_registration = AccountRegistration( - email="user@domain.com", - password="supersecretpassword", - ) # AccountRegistration | A user registering their account (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.LoginApi(api_client) + account_registration = ibutsu_client.AccountRegistration() # AccountRegistration | A user registering their account (optional) + try: api_instance.register(account_registration=account_registration) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->register: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_registration** | [**AccountRegistration**](AccountRegistration.md)| A user registering their account | [optional] + **account_registration** | [**AccountRegistration**](AccountRegistration.md)| A user registering their account | [optional] ### Return type @@ -400,7 +378,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -411,19 +388,17 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **reset_password** -> reset_password() - - +> reset_password(account_reset=account_reset) ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.account_reset import AccountReset +from ibutsu_client.models.account_reset import AccountReset +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -432,28 +407,25 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) - account_reset = AccountReset( - activation_code="YjdmYWFkMTItNzkxZC00MjE4LTgwZGItOWFlOWM2Y2RhOTM5", - password="supersecretpassword", - ) # AccountReset | A user resetting their password (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.LoginApi(api_client) + account_reset = ibutsu_client.AccountReset() # AccountReset | A user resetting their password (optional) + try: api_instance.reset_password(account_reset=account_reset) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->reset_password: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **account_reset** | [**AccountReset**](AccountReset.md)| A user resetting their password | [optional] + **account_reset** | [**AccountReset**](AccountReset.md)| A user resetting their password | [optional] ### Return type @@ -468,7 +440,6 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -481,17 +452,15 @@ No authorization required # **support** > LoginSupport support() - - ### Example ```python -import time import ibutsu_client -from ibutsu_client.api import login_api -from ibutsu_client.model.login_support import LoginSupport +from ibutsu_client.models.login_support import LoginSupport +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -500,20 +469,22 @@ configuration = ibutsu_client.Configuration( # Enter a context with an instance of the API client -with ibutsu_client.ApiClient() as api_client: +with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = login_api.LoginApi(api_client) + api_instance = ibutsu_client.LoginApi(api_client) - # example, this endpoint has no required or optional parameters try: api_response = api_instance.support() + print("The response of LoginApi->support:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling LoginApi->support: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -529,7 +500,6 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/LoginConfig.md b/docs/LoginConfig.md index f6faa00..c130614 100644 --- a/docs/LoginConfig.md +++ b/docs/LoginConfig.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client_id** | **str** | The client ID for the provider | [optional] **redirect_uri** | **str** | The redirect URI for the provider to call back | [optional] **scope** | **str** | The OAuth2 permission scope | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.login_config import LoginConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginConfig from a JSON string +login_config_instance = LoginConfig.from_json(json) +# print the JSON string representation of the object +print(LoginConfig.to_json()) + +# convert the object into a dict +login_config_dict = login_config_instance.to_dict() +# create an instance of LoginConfig from a dict +login_config_from_dict = LoginConfig.from_dict(login_config_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LoginError.md b/docs/LoginError.md index 00a806d..a43d3de 100644 --- a/docs/LoginError.md +++ b/docs/LoginError.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | An error code generated by the server | [optional] **message** | **str** | The error message that corresponds with the error code | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.login_error import LoginError + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginError from a JSON string +login_error_instance = LoginError.from_json(json) +# print the JSON string representation of the object +print(LoginError.to_json()) + +# convert the object into a dict +login_error_dict = login_error_instance.to_dict() +# create an instance of LoginError from a dict +login_error_from_dict = LoginError.from_dict(login_error_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LoginSupport.md b/docs/LoginSupport.md index a78107c..4483918 100644 --- a/docs/LoginSupport.md +++ b/docs/LoginSupport.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | **bool** | Flag to see if email/password login is available | [optional] @@ -10,8 +11,24 @@ Name | Type | Description | Notes **github** | **bool** | Flag to see if GitHub login is available | [optional] **facebook** | **bool** | Flag to see if Facebook login is available | [optional] **gitlab** | **bool** | Flag to see if GitLab login is available | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.login_support import LoginSupport + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginSupport from a JSON string +login_support_instance = LoginSupport.from_json(json) +# print the JSON string representation of the object +print(LoginSupport.to_json()) + +# convert the object into a dict +login_support_dict = login_support_instance.to_dict() +# create an instance of LoginSupport from a dict +login_support_from_dict = LoginSupport.from_dict(login_support_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LoginToken.md b/docs/LoginToken.md index 297a92d..74a5ffd 100644 --- a/docs/LoginToken.md +++ b/docs/LoginToken.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **token** | **str** | The JWT token returned from a successful login | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.login_token import LoginToken + +# TODO update the JSON string below +json = "{}" +# create an instance of LoginToken from a JSON string +login_token_instance = LoginToken.from_json(json) +# print the JSON string representation of the object +print(LoginToken.to_json()) + +# convert the object into a dict +login_token_dict = login_token_instance.to_dict() +# create an instance of LoginToken from a dict +login_token_from_dict = LoginToken.from_dict(login_token_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ModelImport.md b/docs/ModelImport.md index 1b126ab..d979a7c 100644 --- a/docs/ModelImport.md +++ b/docs/ModelImport.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The database ID of the import | [optional] @@ -9,8 +10,24 @@ Name | Type | Description | Notes **filename** | **str** | The name of the file that was uploaded | [optional] **format** | **str** | The format of the file uploaded | [optional] **run_id** | **str** | The ID of the run from the import | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.model_import import ModelImport + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelImport from a JSON string +model_import_instance = ModelImport.from_json(json) +# print the JSON string representation of the object +print(ModelImport.to_json()) + +# convert the object into a dict +model_import_dict = model_import_instance.to_dict() +# create an instance of ModelImport from a dict +model_import_from_dict = ModelImport.from_dict(model_import_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Pagination.md b/docs/Pagination.md index cd5b197..0a68751 100644 --- a/docs/Pagination.md +++ b/docs/Pagination.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | **int** | The current page number | [optional] **page_size** | **int** | The number of items per page | [optional] **total_pages** | **int** | The total number of pages | [optional] **total_items** | **int** | The total number of items for this query | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.pagination import Pagination + +# TODO update the JSON string below +json = "{}" +# create an instance of Pagination from a JSON string +pagination_instance = Pagination.from_json(json) +# print the JSON string representation of the object +print(Pagination.to_json()) + +# convert the object into a dict +pagination_dict = pagination_instance.to_dict() +# create an instance of Pagination from a dict +pagination_from_dict = Pagination.from_dict(pagination_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Project.md b/docs/Project.md index e7d949f..71a97fa 100644 --- a/docs/Project.md +++ b/docs/Project.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the project | [optional] **name** | **str** | The machine name of the project | [optional] **title** | **str** | The human-readable title of the project | [optional] -**owner_id** | **str, none_type** | The ID of the owner of this project | [optional] -**group_id** | **str, none_type** | The ID of the group of this project | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**owner_id** | **str** | The ID of the owner of this project | [optional] +**group_id** | **str** | The ID of the group of this project | [optional] + +## Example + +```python +from ibutsu_client.models.project import Project + +# TODO update the JSON string below +json = "{}" +# create an instance of Project from a JSON string +project_instance = Project.from_json(json) +# print the JSON string representation of the object +print(Project.to_json()) +# convert the object into a dict +project_dict = project_instance.to_dict() +# create an instance of Project from a dict +project_from_dict = Project.from_dict(project_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ProjectApi.md b/docs/ProjectApi.md index 7fbc279..d113338 100644 --- a/docs/ProjectApi.md +++ b/docs/ProjectApi.md @@ -5,13 +5,14 @@ All URIs are relative to */api* Method | HTTP request | Description ------------- | ------------- | ------------- [**add_project**](ProjectApi.md#add_project) | **POST** /project | Create a project +[**get_filter_params**](ProjectApi.md#get_filter_params) | **GET** /project/filter-params/{id} | Get a project's filterable parameters [**get_project**](ProjectApi.md#get_project) | **GET** /project/{id} | Get a single project by ID [**get_project_list**](ProjectApi.md#get_project_list) | **GET** /project | Get a list of projects [**update_project**](ProjectApi.md#update_project) | **PUT** /project/{id} | Update a project # **add_project** -> Project add_project(project) +> Project add_project(project=project) Create a project @@ -20,11 +21,11 @@ Create a project * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import project_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -38,36 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = project_api.ProjectApi(api_client) - project = Project( - id="44941c55-9736-42f6-acce-ca3c4739d0f3", - name="my-project", - title="My project", - owner_id="6b8b01ad-a17e-4ca1-8df5-fadb41439567", - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # Project | Project - - # example passing only required values which don't have defaults set + api_instance = ibutsu_client.ProjectApi(api_client) + project = ibutsu_client.Project() # Project | A project object (optional) + try: # Create a project - api_response = api_instance.add_project(project) + api_response = api_instance.add_project(project=project) + print("The response of ProjectApi->add_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ProjectApi->add_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **project** | [**Project**](Project.md)| Project | + **project** | [**Project**](Project.md)| A project object | [optional] ### Return type @@ -82,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -92,6 +88,83 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_filter_params** +> List[str] get_filter_params(id) + +Get a project's filterable parameters + +### Example + +* Bearer (JWT) Authentication (jwt): + +```python +import ibutsu_client +from ibutsu_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api +# See configuration.py for a list of all supported configuration parameters. +configuration = ibutsu_client.Configuration( + host = "/api" +) + +# 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): jwt +configuration = ibutsu_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with ibutsu_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = ibutsu_client.ProjectApi(api_client) + id = 'id_example' # str | ID of test project + + try: + # Get a project's filterable parameters + api_response = api_instance.get_filter_params(id) + print("The response of ProjectApi->get_filter_params:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ProjectApi->get_filter_params: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| ID of test project | + +### Return type + +**List[str]** + +### Authorization + +[jwt](../README.md#jwt) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of filterable parameters from the project's results | - | +**401** | Unauthorized - user does not have access to this project | - | +**404** | Project not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_project** > Project get_project(id) @@ -102,11 +175,11 @@ Get a single project by ID * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import project_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -120,30 +193,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = project_api.ProjectApi(api_client) - id = "id_example" # str | ID of test project + api_instance = ibutsu_client.ProjectApi(api_client) + id = 'id_example' # str | ID of test project - # example passing only required values which don't have defaults set try: # Get a single project by ID api_response = api_instance.get_project(id) + print("The response of ProjectApi->get_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ProjectApi->get_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of test project | + **id** | **str**| ID of test project | ### Return type @@ -158,7 +233,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -169,7 +243,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_project_list** -> ProjectList get_project_list() +> ProjectList get_project_list(filter=filter, owner_id=owner_id, group_id=group_id, page=page, page_size=page_size) Get a list of projects @@ -178,11 +252,11 @@ Get a list of projects * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import project_api -from ibutsu_client.model.project_list import ProjectList +from ibutsu_client.models.project_list import ProjectList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -196,41 +270,40 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = project_api.ProjectApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - owner_id = "ownerId_example" # str | Filter projects by owner ID (optional) - group_id = "groupId_example" # str | Filter projects by group ID (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.ProjectApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + owner_id = 'owner_id_example' # str | Filter projects by owner ID (optional) + group_id = 'group_id_example' # str | Filter projects by group ID (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Get a list of projects api_response = api_instance.get_project_list(filter=filter, owner_id=owner_id, group_id=group_id, page=page, page_size=page_size) + print("The response of ProjectApi->get_project_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ProjectApi->get_project_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **owner_id** | **str**| Filter projects by owner ID | [optional] - **group_id** | **str**| Filter projects by group ID | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **owner_id** | **str**| Filter projects by owner ID | [optional] + **group_id** | **str**| Filter projects by group ID | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -245,7 +318,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -255,7 +327,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_project** -> Project update_project(id) +> Project update_project(id, project=project) Update a project @@ -264,11 +336,11 @@ Update a project * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import project_api -from ibutsu_client.model.project import Project +from ibutsu_client.models.project import Project +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -282,47 +354,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = project_api.ProjectApi(api_client) - id = "id_example" # str | ID of test project - project = Project( - id="44941c55-9736-42f6-acce-ca3c4739d0f3", - name="my-project", - title="My project", - owner_id="6b8b01ad-a17e-4ca1-8df5-fadb41439567", - group_id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - ) # Project | Project (optional) - - # example passing only required values which don't have defaults set - try: - # Update a project - api_response = api_instance.update_project(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling ProjectApi->update_project: %s\n" % e) + api_instance = ibutsu_client.ProjectApi(api_client) + id = 'id_example' # str | ID of test project + project = ibutsu_client.Project() # Project | A project object (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update a project api_response = api_instance.update_project(id, project=project) + print("The response of ProjectApi->update_project:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ProjectApi->update_project: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of test project | - **project** | [**Project**](Project.md)| Project | [optional] + **id** | **str**| ID of test project | + **project** | [**Project**](Project.md)| A project object | [optional] ### Return type @@ -337,7 +396,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ProjectList.md b/docs/ProjectList.md index 597d5d9..20087f4 100644 --- a/docs/ProjectList.md +++ b/docs/ProjectList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**projects** | [**[Project]**](Project.md) | | [optional] +**projects** | [**List[Project]**](Project.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.project_list import ProjectList + +# TODO update the JSON string below +json = "{}" +# create an instance of ProjectList from a JSON string +project_list_instance = ProjectList.from_json(json) +# print the JSON string representation of the object +print(ProjectList.to_json()) + +# convert the object into a dict +project_list_dict = project_list_instance.to_dict() +# create an instance of ProjectList from a dict +project_list_from_dict = ProjectList.from_dict(project_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Report.md b/docs/Report.md index 7817e5f..9a61846 100644 --- a/docs/Report.md +++ b/docs/Report.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the report | [optional] @@ -12,8 +13,24 @@ Name | Type | Description | Notes **view_url** | **str** | The URL to the viewable report | [optional] **parameters** | [**ReportParameters**](ReportParameters.md) | | [optional] **status** | **str** | The status of the report, one of \"pending\", \"running\", \"done\" | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.report import Report + +# TODO update the JSON string below +json = "{}" +# create an instance of Report from a JSON string +report_instance = Report.from_json(json) +# print the JSON string representation of the object +print(Report.to_json()) + +# convert the object into a dict +report_dict = report_instance.to_dict() +# create an instance of Report from a dict +report_from_dict = Report.from_dict(report_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ReportApi.md b/docs/ReportApi.md index b02f131..95d15e6 100644 --- a/docs/ReportApi.md +++ b/docs/ReportApi.md @@ -23,12 +23,12 @@ Create a new report * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api -from ibutsu_client.model.report_parameters import ReportParameters -from ibutsu_client.model.report import Report +from ibutsu_client.models.report import Report +from ibutsu_client.models.report_parameters import ReportParameters +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -42,34 +42,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - report_parameters = ReportParameters( - type="dashboard", - filter="test_navigation", - source="iqe-jenkins", - ) # ReportParameters | The parameters for the report - - # example passing only required values which don't have defaults set + api_instance = ibutsu_client.ReportApi(api_client) + report_parameters = ibutsu_client.ReportParameters() # ReportParameters | The parameters for the report + try: # Create a new report api_response = api_instance.add_report(report_parameters) + print("The response of ReportApi->add_report:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->add_report: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **report_parameters** | [**ReportParameters**](ReportParameters.md)| The parameters for the report | + **report_parameters** | [**ReportParameters**](ReportParameters.md)| The parameters for the report | ### Return type @@ -84,7 +82,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -104,10 +101,10 @@ Delete a report * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -121,29 +118,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - id = "id_example" # str | ID of report to delete + api_instance = ibutsu_client.ReportApi(api_client) + id = 'id_example' # str | ID of report to delete - # example passing only required values which don't have defaults set try: # Delete a report api_instance.delete_report(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->delete_report: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of report to delete | + **id** | **str**| ID of report to delete | ### Return type @@ -158,7 +156,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -169,7 +166,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **download_report** -> file_type download_report(id, filename) +> bytearray download_report(id, filename) Download a report @@ -178,10 +175,10 @@ Download a report * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -195,36 +192,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - id = "id_example" # str | The ID of the report - filename = "filename_example" # str | The file name of the downloadable report + api_instance = ibutsu_client.ReportApi(api_client) + id = 'id_example' # str | The ID of the report + filename = 'filename_example' # str | The file name of the downloadable report - # example passing only required values which don't have defaults set try: # Download a report api_response = api_instance.download_report(id, filename) + print("The response of ReportApi->download_report:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->download_report: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the report | - **filename** | **str**| The file name of the downloadable report | + **id** | **str**| The ID of the report | + **filename** | **str**| The file name of the downloadable report | ### Return type -**file_type** +**bytearray** ### Authorization @@ -235,7 +234,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: text/plain, application/csv, application/json, text/html, application/zip - ### HTTP response details | Status code | Description | Response headers | @@ -255,11 +253,11 @@ Get a report * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api -from ibutsu_client.model.report import Report +from ibutsu_client.models.report import Report +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -273,30 +271,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - id = "id_example" # str | The ID of the report + api_instance = ibutsu_client.ReportApi(api_client) + id = 'id_example' # str | The ID of the report - # example passing only required values which don't have defaults set try: # Get a report api_response = api_instance.get_report(id) + print("The response of ReportApi->get_report:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->get_report: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the report | + **id** | **str**| The ID of the report | ### Return type @@ -311,7 +311,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -322,7 +321,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_report_list** -> ReportList get_report_list() +> ReportList get_report_list(page=page, page_size=page_size, project=project) Get a list of reports @@ -331,11 +330,11 @@ Get a list of reports * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api -from ibutsu_client.model.report_list import ReportList +from ibutsu_client.models.report_list import ReportList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -349,35 +348,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - project = "project_example" # str | Filter reports by project ID (optional) + api_instance = ibutsu_client.ReportApi(api_client) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + project = 'project_example' # str | Filter reports by project ID (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get a list of reports api_response = api_instance.get_report_list(page=page, page_size=page_size, project=project) + print("The response of ReportApi->get_report_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->get_report_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] - **project** | **str**| Filter reports by project ID | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **project** | **str**| Filter reports by project ID | [optional] ### Return type @@ -392,7 +392,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -402,7 +401,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_report_types** -> [GetReportTypes200ResponseInner] get_report_types() +> List[GetReportTypes200ResponseInner] get_report_types() Get a list of report types @@ -411,11 +410,11 @@ Get a list of report types * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api -from ibutsu_client.model.get_report_types200_response_inner import GetReportTypes200ResponseInner +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -429,30 +428,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) + api_instance = ibutsu_client.ReportApi(api_client) - # example, this endpoint has no required or optional parameters try: # Get a list of report types api_response = api_instance.get_report_types() + print("The response of ReportApi->get_report_types:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->get_report_types: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type -[**[GetReportTypes200ResponseInner]**](GetReportTypes200ResponseInner.md) +[**List[GetReportTypes200ResponseInner]**](GetReportTypes200ResponseInner.md) ### Authorization @@ -463,7 +464,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -473,7 +473,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **view_report** -> file_type view_report(id, filename) +> bytearray view_report(id, filename) View a report @@ -482,10 +482,10 @@ View a report * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import report_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -499,36 +499,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = report_api.ReportApi(api_client) - id = "id_example" # str | The ID of the report - filename = "filename_example" # str | The file name of the downloadable report + api_instance = ibutsu_client.ReportApi(api_client) + id = 'id_example' # str | The ID of the report + filename = 'filename_example' # str | The file name of the downloadable report - # example passing only required values which don't have defaults set try: # View a report api_response = api_instance.view_report(id, filename) + print("The response of ReportApi->view_report:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ReportApi->view_report: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the report | - **filename** | **str**| The file name of the downloadable report | + **id** | **str**| The ID of the report | + **filename** | **str**| The file name of the downloadable report | ### Return type -**file_type** +**bytearray** ### Authorization @@ -539,7 +541,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: text/plain, application/csv, application/json, text/html, application/zip - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ReportList.md b/docs/ReportList.md index 1d37450..1579340 100644 --- a/docs/ReportList.md +++ b/docs/ReportList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**reports** | [**[Report]**](Report.md) | | [optional] +**reports** | [**List[Report]**](Report.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.report_list import ReportList + +# TODO update the JSON string below +json = "{}" +# create an instance of ReportList from a JSON string +report_list_instance = ReportList.from_json(json) +# print the JSON string representation of the object +print(ReportList.to_json()) + +# convert the object into a dict +report_list_dict = report_list_instance.to_dict() +# create an instance of ReportList from a dict +report_list_from_dict = ReportList.from_dict(report_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ReportParameters.md b/docs/ReportParameters.md index 96fcfd5..e838f82 100644 --- a/docs/ReportParameters.md +++ b/docs/ReportParameters.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | The type of report to generate | [optional] +**type** | **str** | The type of report to generate | **filter** | **str** | A regular expression to filter test results by | [optional] **source** | **str** | The source of the test results | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.report_parameters import ReportParameters + +# TODO update the JSON string below +json = "{}" +# create an instance of ReportParameters from a JSON string +report_parameters_instance = ReportParameters.from_json(json) +# print the JSON string representation of the object +print(ReportParameters.to_json()) + +# convert the object into a dict +report_parameters_dict = report_parameters_instance.to_dict() +# create an instance of ReportParameters from a dict +report_parameters_from_dict = ReportParameters.from_dict(report_parameters_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Result.md b/docs/Result.md index 3759eb8..08997f7 100644 --- a/docs/Result.md +++ b/docs/Result.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the test result | [optional] @@ -9,15 +10,31 @@ Name | Type | Description | Notes **start_time** | **str** | Timestamp of starttime. | [optional] **duration** | **float** | Duration of test in seconds. | [optional] **result** | **str** | Status of result. | [optional] -**component** | **str, none_type** | A component | [optional] -**env** | **str, none_type** | The environment which is being tested | [optional] -**run_id** | **str, none_type** | The run this result is associated with | [optional] -**project_id** | **str, none_type** | The project this run is associated with | [optional] -**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**params** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**component** | **str** | A component | [optional] +**env** | **str** | The environment which is being tested | [optional] +**run_id** | **str** | The run this result is associated with | [optional] +**project_id** | **str** | The project this run is associated with | [optional] +**metadata** | **object** | | [optional] +**params** | **object** | | [optional] **source** | **str** | Where the data came from (useful for filtering) | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.result import Result + +# TODO update the JSON string below +json = "{}" +# create an instance of Result from a JSON string +result_instance = Result.from_json(json) +# print the JSON string representation of the object +print(Result.to_json()) + +# convert the object into a dict +result_dict = result_instance.to_dict() +# create an instance of Result from a dict +result_from_dict = Result.from_dict(result_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ResultApi.md b/docs/ResultApi.md index 3afc20f..ad8e3db 100644 --- a/docs/ResultApi.md +++ b/docs/ResultApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description # **add_result** -> Result add_result() +> Result add_result(result=result) Create a test result @@ -20,11 +20,11 @@ Create a test result * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import result_api -from ibutsu_client.model.result import Result +from ibutsu_client.models.result import Result +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -38,44 +38,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = result_api.ResultApi(api_client) - result = Result( - id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - test_id="test_click_on_button", - start_time="start_time_example", - duration=3.14, - result="passed", - component="login", - env="qa", - run_id="64c2ab9e-cd64-4815-bf73-83b00c2e650f", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - metadata={}, - params={}, - source="source_example", - ) # Result | Result item (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.ResultApi(api_client) + result = ibutsu_client.Result() # Result | Result item (optional) + try: # Create a test result api_response = api_instance.add_result(result=result) + print("The response of ResultApi->add_result:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ResultApi->add_result: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **result** | [**Result**](Result.md)| Result item | [optional] + **result** | [**Result**](Result.md)| Result item | [optional] ### Return type @@ -90,7 +78,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -110,11 +97,11 @@ Get a single result * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import result_api -from ibutsu_client.model.result import Result +from ibutsu_client.models.result import Result +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -128,30 +115,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = result_api.ResultApi(api_client) - id = "id_example" # str | ID of result to return (uuid required) + api_instance = ibutsu_client.ResultApi(api_client) + id = 'id_example' # str | ID of result to return (uuid required) - # example passing only required values which don't have defaults set try: # Get a single result api_response = api_instance.get_result(id) + print("The response of ResultApi->get_result:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ResultApi->get_result: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of result to return (uuid required) | + **id** | **str**| ID of result to return (uuid required) | ### Return type @@ -166,7 +155,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -177,22 +165,54 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_result_list** -> ResultList get_result_list() +> ResultList get_result_list(filter=filter, estimate=estimate, page=page, page_size=page_size) Get the list of results. -The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /result?filter=metadata.run=63fe5 /result?filter=test_id~neg /result?filter=result!passed +The `filter` parameter takes a list of filters to apply in the form of: + + {name}{operator}{value} + +where: + + - `name` is any valid column in the database + - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` + - `value` is what you want to filter by + +Operators are simple correspondents to MongoDB's query selectors: + + - `=` becomes `$eq` + - `!` becomes `$ne` + - `>` becomes `$gt` + - `<` becomes `$lt` + - `)` becomes `$gte` + - `(` becomes `$lte` + - `~` becomes `$regex` + - `*` becomes `$in` + - `@` becomes `$exists` + +Notes: + +- For the `$exists` operator, "true", "t", "yes", "y" and `1` will all be considered true, + all other values are considered false. + +Example queries: + + /result?filter=metadata.run=63fe5 + /result?filter=test_id~neg + /result?filter=result!passed + ### Example * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import result_api -from ibutsu_client.model.result_list import ResultList +from ibutsu_client.models.result_list import ResultList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -206,39 +226,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = result_api.ResultApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) + api_instance = ibutsu_client.ResultApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) estimate = True # bool | Return an estimated count (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get the list of results. api_response = api_instance.get_result_list(filter=filter, estimate=estimate, page=page, page_size=page_size) + print("The response of ResultApi->get_result_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ResultApi->get_result_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **estimate** | **bool**| Return an estimated count | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **estimate** | **bool**| Return an estimated count | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -253,7 +272,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -264,7 +282,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_result** -> Result update_result(id) +> Result update_result(id, result=result) Updates a single result @@ -273,11 +291,11 @@ Updates a single result * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import result_api -from ibutsu_client.model.result import Result +from ibutsu_client.models.result import Result +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -291,54 +309,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = result_api.ResultApi(api_client) - id = "id_example" # str | ID of result to update - result = Result( - id="a16ad60e-bf23-4195-99dc-594858ad3e5e", - test_id="test_click_on_button", - start_time="start_time_example", - duration=3.14, - result="passed", - component="login", - env="qa", - run_id="64c2ab9e-cd64-4815-bf73-83b00c2e650f", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - metadata={}, - params={}, - source="source_example", - ) # Result | Result item (optional) - - # example passing only required values which don't have defaults set - try: - # Updates a single result - api_response = api_instance.update_result(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling ResultApi->update_result: %s\n" % e) + api_instance = ibutsu_client.ResultApi(api_client) + id = 'id_example' # str | ID of result to update + result = ibutsu_client.Result() # Result | Result item (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Updates a single result api_response = api_instance.update_result(id, result=result) + print("The response of ResultApi->update_result:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling ResultApi->update_result: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of result to update | - **result** | [**Result**](Result.md)| Result item | [optional] + **id** | **str**| ID of result to update | + **result** | [**Result**](Result.md)| Result item | [optional] ### Return type @@ -353,7 +351,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ResultList.md b/docs/ResultList.md index a15ebef..ea432d7 100644 --- a/docs/ResultList.md +++ b/docs/ResultList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**results** | [**[Result]**](Result.md) | | [optional] +**results** | [**List[Result]**](Result.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.result_list import ResultList + +# TODO update the JSON string below +json = "{}" +# create an instance of ResultList from a JSON string +result_list_instance = ResultList.from_json(json) +# print the JSON string representation of the object +print(ResultList.to_json()) + +# convert the object into a dict +result_list_dict = result_list_instance.to_dict() +# create an instance of ResultList from a dict +result_list_from_dict = ResultList.from_dict(result_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Run.md b/docs/Run.md index cd2c657..0478a33 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -2,20 +2,37 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique ID of the test run | [optional] **created** | **str** | The time this record was created | [optional] **duration** | **float** | Duration of tests in seconds | [optional] -**source** | **str, none_type** | A source for this test run | [optional] +**source** | **str** | A source for this test run | [optional] **start_time** | **str** | The time the test run started | [optional] -**component** | **str, none_type** | A component | [optional] -**env** | **str, none_type** | The environment which is being tested | [optional] -**project_id** | **str, none_type** | The project this run is associated with | [optional] -**summary** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | A summary of the test results | [optional] -**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Extra metadata for this run | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**component** | **str** | A component | [optional] +**env** | **str** | The environment which is being tested | [optional] +**project_id** | **str** | The project this run is associated with | [optional] +**summary** | **object** | A summary of the test results | [optional] +**metadata** | **object** | Extra metadata for this run | [optional] + +## Example + +```python +from ibutsu_client.models.run import Run + +# TODO update the JSON string below +json = "{}" +# create an instance of Run from a JSON string +run_instance = Run.from_json(json) +# print the JSON string representation of the object +print(Run.to_json()) +# convert the object into a dict +run_dict = run_instance.to_dict() +# create an instance of Run from a dict +run_from_dict = Run.from_dict(run_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RunApi.md b/docs/RunApi.md index ee234f4..d585807 100644 --- a/docs/RunApi.md +++ b/docs/RunApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **add_run** -> Run add_run() +> Run add_run(run=run) Create a run @@ -21,11 +21,11 @@ Create a run * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import run_api -from ibutsu_client.model.run import Run +from ibutsu_client.models.run import Run +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,42 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = run_api.RunApi(api_client) - run = Run( - id="64c2ab9e-cd64-4815-bf73-83b00c2e650f", - created="2020-05-15T16:18:32.014053", - duration=154.778524555, - source="my-tests", - start_time="2020-05-15T16:18:32.014053", - component="login", - env="qa", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - summary={}, - metadata={}, - ) # Run | Run item (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.RunApi(api_client) + run = ibutsu_client.Run() # Run | A run object (optional) + try: # Create a run api_response = api_instance.add_run(run=run) + print("The response of RunApi->add_run:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling RunApi->add_run: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **run** | [**Run**](Run.md)| Run item | [optional] + **run** | [**Run**](Run.md)| A run object | [optional] ### Return type @@ -89,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -100,7 +89,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **bulk_update** -> RunList bulk_update(update_run) +> RunList bulk_update(filter=filter, page_size=page_size, update_run=update_run) Update multiple runs with common metadata @@ -109,12 +98,12 @@ Update multiple runs with common metadata * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import run_api -from ibutsu_client.model.run_list import RunList -from ibutsu_client.model.update_run import UpdateRun +from ibutsu_client.models.run_list import RunList +from ibutsu_client.models.update_run import UpdateRun +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -128,47 +117,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = run_api.RunApi(api_client) - update_run = UpdateRun( - metadata={}, - ) # UpdateRun | The metadata to add to the test runs - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - try: - # Update multiple runs with common metadata - api_response = api_instance.bulk_update(update_run) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling RunApi->bulk_update: %s\n" % e) + api_instance = ibutsu_client.RunApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + update_run = ibutsu_client.UpdateRun() # UpdateRun | Run metadata updates (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update multiple runs with common metadata - api_response = api_instance.bulk_update(update_run, filter=filter, page_size=page_size) + api_response = api_instance.bulk_update(filter=filter, page_size=page_size, update_run=update_run) + print("The response of RunApi->bulk_update:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling RunApi->bulk_update: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **update_run** | [**UpdateRun**](UpdateRun.md)| The metadata to add to the test runs | - **filter** | **[str]**| Fields to filter by | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **update_run** | [**UpdateRun**](UpdateRun.md)| Run metadata updates | [optional] ### Return type @@ -183,7 +161,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -206,11 +183,11 @@ Get a single run by ID (uuid required) * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import run_api -from ibutsu_client.model.run import Run +from ibutsu_client.models.run import Run +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -224,30 +201,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = run_api.RunApi(api_client) - id = "id_example" # str | ID of test run + api_instance = ibutsu_client.RunApi(api_client) + id = 'id_example' # str | ID of test run - # example passing only required values which don't have defaults set try: # Get a single run by ID (uuid required) api_response = api_instance.get_run(id) + print("The response of RunApi->get_run:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling RunApi->get_run: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of test run | + **id** | **str**| ID of test run | ### Return type @@ -262,7 +241,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -273,22 +251,55 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_run_list** -> RunList get_run_list() +> RunList get_run_list(filter=filter, estimate=estimate, page=page, page_size=page_size) Get a list of the test runs -The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /run?filter=metadata.jenkins.job_name=jenkins_job /run?filter=summary.failures>0 +The `filter` parameter takes a list of filters to apply in the form of: + + + {name}{operator}{value} + + +where: + + - `name` is any valid column in the database + - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` + - `value` is what you want to filter by + +Operators are simple correspondents to MongoDB's query selectors: + + - `=` becomes `$eq` + - `!` becomes `$ne` + - `>` becomes `$gt` + - `<` becomes `$lt` + - `)` becomes `$gte` + - `(` becomes `$lte` + - `~` becomes `$regex` + - `*` becomes `$in` + - `@` becomes `$exists` + +Notes: + +- For the `$exists` operator, "true", "t", "yes", "y" and `1` will all be considered true, + all other values are considered false. + +Example queries: + + /run?filter=metadata.jenkins.job_name=jenkins_job + /run?filter=summary.failures>0 + ### Example * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import run_api -from ibutsu_client.model.run_list import RunList +from ibutsu_client.models.run_list import RunList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -302,39 +313,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = run_api.RunApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) + api_instance = ibutsu_client.RunApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) estimate = True # bool | Return an estimated count (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get a list of the test runs api_response = api_instance.get_run_list(filter=filter, estimate=estimate, page=page, page_size=page_size) + print("The response of RunApi->get_run_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling RunApi->get_run_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **estimate** | **bool**| Return an estimated count | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **estimate** | **bool**| Return an estimated count | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -349,7 +359,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -360,7 +369,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_run** -> Run update_run(id, run) +> Run update_run(id, run=run) Update a single run @@ -369,11 +378,11 @@ Update a single run * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import run_api -from ibutsu_client.model.run import Run +from ibutsu_client.models.run import Run +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -387,43 +396,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = run_api.RunApi(api_client) - id = "id_example" # str | ID of the test run - run = Run( - id="64c2ab9e-cd64-4815-bf73-83b00c2e650f", - created="2020-05-15T16:18:32.014053", - duration=154.778524555, - source="my-tests", - start_time="2020-05-15T16:18:32.014053", - component="login", - env="qa", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - summary={}, - metadata={}, - ) # Run | The updated test run - - # example passing only required values which don't have defaults set + api_instance = ibutsu_client.RunApi(api_client) + id = 'id_example' # str | ID of the test run + run = ibutsu_client.Run() # Run | A run object (optional) + try: # Update a single run - api_response = api_instance.update_run(id, run) + api_response = api_instance.update_run(id, run=run) + print("The response of RunApi->update_run:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling RunApi->update_run: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of the test run | - **run** | [**Run**](Run.md)| The updated test run | + **id** | **str**| ID of the test run | + **run** | [**Run**](Run.md)| A run object | [optional] ### Return type @@ -438,7 +438,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/RunList.md b/docs/RunList.md index 221f498..eb6348e 100644 --- a/docs/RunList.md +++ b/docs/RunList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**runs** | [**[Run]**](Run.md) | | [optional] +**runs** | [**List[Run]**](Run.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.run_list import RunList + +# TODO update the JSON string below +json = "{}" +# create an instance of RunList from a JSON string +run_list_instance = RunList.from_json(json) +# print the JSON string representation of the object +print(RunList.to_json()) + +# convert the object into a dict +run_list_dict = run_list_instance.to_dict() +# create an instance of RunList from a dict +run_list_from_dict = RunList.from_dict(run_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TaskApi.md b/docs/TaskApi.md index 4b9c059..92720e9 100644 --- a/docs/TaskApi.md +++ b/docs/TaskApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **get_task** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} get_task(id) +> object get_task(id) Get the status or result of a task @@ -17,10 +17,10 @@ Get the status or result of a task * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import task_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -34,34 +34,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = task_api.TaskApi(api_client) - id = "id_example" # str | The ID of the task + api_instance = ibutsu_client.TaskApi(api_client) + id = 'id_example' # str | The ID of the task - # example passing only required values which don't have defaults set try: # Get the status or result of a task api_response = api_instance.get_task(id) + print("The response of TaskApi->get_task:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling TaskApi->get_task: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The ID of the task | + **id** | **str**| The ID of the task | ### Return type -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** +**object** ### Authorization @@ -72,7 +74,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/Token.md b/docs/Token.md index fde3868..8f886dc 100644 --- a/docs/Token.md +++ b/docs/Token.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The ID of the token | **user_id** | **str** | The ID of the user that owns this token | **name** | **str** | The name given to this token | +**expires** | **str** | The date and time when this token expires | [optional] **token** | **str** | The token itself | -**expires** | **str, none_type** | The date and time when this token expires | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.token import Token + +# TODO update the JSON string below +json = "{}" +# create an instance of Token from a JSON string +token_instance = Token.from_json(json) +# print the JSON string representation of the object +print(Token.to_json()) + +# convert the object into a dict +token_dict = token_instance.to_dict() +# create an instance of Token from a dict +token_from_dict = Token.from_dict(token_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TokenList.md b/docs/TokenList.md index aaf935a..379c91c 100644 --- a/docs/TokenList.md +++ b/docs/TokenList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**tokens** | [**[Token]**](Token.md) | | [optional] +**tokens** | [**List[Token]**](Token.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.token_list import TokenList + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenList from a JSON string +token_list_instance = TokenList.from_json(json) +# print the JSON string representation of the object +print(TokenList.to_json()) + +# convert the object into a dict +token_list_dict = token_list_instance.to_dict() +# create an instance of TokenList from a dict +token_list_from_dict = TokenList.from_dict(token_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateRun.md b/docs/UpdateRun.md index 25c3b9f..d8309c6 100644 --- a/docs/UpdateRun.md +++ b/docs/UpdateRun.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Extra data for this run | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**metadata** | **object** | Extra data for this run | [optional] + +## Example + +```python +from ibutsu_client.models.update_run import UpdateRun + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateRun from a JSON string +update_run_instance = UpdateRun.from_json(json) +# print the JSON string representation of the object +print(UpdateRun.to_json()) +# convert the object into a dict +update_run_dict = update_run_instance.to_dict() +# create an instance of UpdateRun from a dict +update_run_from_dict = UpdateRun.from_dict(update_run_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/User.md b/docs/User.md index 35abbb0..a780a72 100644 --- a/docs/User.md +++ b/docs/User.md @@ -2,16 +2,33 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **str** | The user's e-mail address | **id** | **str** | The ID of the user | [optional] -**name** | **str, none_type** | The user's name | [optional] +**email** | **str** | The user's e-mail address | +**name** | **str** | The user's name | [optional] **is_superadmin** | **bool** | Flag to show if a user is a super-admin | [optional] **is_active** | **bool** | Flag to show if the user is active | [optional] -**group_id** | **str, none_type** | The ID of the group of this project | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**group_id** | **str** | The ID of the group of this project | [optional] + +## Example + +```python +from ibutsu_client.models.user import User + +# TODO update the JSON string below +json = "{}" +# create an instance of User from a JSON string +user_instance = User.from_json(json) +# print the JSON string representation of the object +print(User.to_json()) +# convert the object into a dict +user_dict = user_instance.to_dict() +# create an instance of User from a dict +user_from_dict = User.from_dict(user_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserApi.md b/docs/UserApi.md index c124936..6c5e75d 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **add_token** -> Token add_token() +> Token add_token(create_token=create_token) Create a token for the current user @@ -22,12 +22,12 @@ Create a token for the current user * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api -from ibutsu_client.model.token import Token -from ibutsu_client.model.create_token import CreateToken +from ibutsu_client.models.create_token import CreateToken +from ibutsu_client.models.token import Token +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -41,34 +41,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - create_token = CreateToken( - name="My user token", - expires="2038-12-31T23:59:59+0000", - ) # CreateToken | Create a token for a user (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.UserApi(api_client) + create_token = ibutsu_client.CreateToken() # CreateToken | Create a token for a user (optional) + try: # Create a token for the current user api_response = api_instance.add_token(create_token=create_token) + print("The response of UserApi->add_token:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->add_token: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **create_token** | [**CreateToken**](CreateToken.md)| Create a token for a user | [optional] + **create_token** | [**CreateToken**](CreateToken.md)| Create a token for a user | [optional] ### Return type @@ -83,7 +81,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -103,10 +100,10 @@ Delete the token * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -120,29 +117,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - id = "id_example" # str | The id of a token + api_instance = ibutsu_client.UserApi(api_client) + id = 'id_example' # str | The id of a token - # example passing only required values which don't have defaults set try: # Delete the token api_instance.delete_token(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->delete_token: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The id of a token | + **id** | **str**| The id of a token | ### Return type @@ -157,7 +155,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -177,11 +174,11 @@ Return the user details for the current user * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api -from ibutsu_client.model.user import User +from ibutsu_client.models.user import User +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -195,25 +192,27 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) + api_instance = ibutsu_client.UserApi(api_client) - # example, this endpoint has no required or optional parameters try: # Return the user details for the current user api_response = api_instance.get_current_user() + print("The response of UserApi->get_current_user:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->get_current_user: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -229,7 +228,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -249,11 +247,11 @@ Retrieve a single token for the current user * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api -from ibutsu_client.model.token import Token +from ibutsu_client.models.token import Token +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -267,30 +265,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - id = "id_example" # str | The id of a token + api_instance = ibutsu_client.UserApi(api_client) + id = 'id_example' # str | The id of a token - # example passing only required values which don't have defaults set try: # Retrieve a single token for the current user api_response = api_instance.get_token(id) + print("The response of UserApi->get_token:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->get_token: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The id of a token | + **id** | **str**| The id of a token | ### Return type @@ -305,7 +305,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -316,7 +315,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_token_list** -> TokenList get_token_list() +> TokenList get_token_list(page=page, page_size=page_size) Return the tokens for the user @@ -325,11 +324,11 @@ Return the tokens for the user * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api -from ibutsu_client.model.token_list import TokenList +from ibutsu_client.models.token_list import TokenList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -343,33 +342,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) + api_instance = ibutsu_client.UserApi(api_client) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Return the tokens for the user api_response = api_instance.get_token_list(page=page, page_size=page_size) + print("The response of UserApi->get_token_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->get_token_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -384,7 +384,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -404,11 +403,11 @@ Return the user details for the current user * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import user_api -from ibutsu_client.model.user import User +from ibutsu_client.models.user import User +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -422,25 +421,27 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = user_api.UserApi(api_client) + api_instance = ibutsu_client.UserApi(api_client) - # example, this endpoint has no required or optional parameters try: # Return the user details for the current user api_response = api_instance.update_current_user() + print("The response of UserApi->update_current_user:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling UserApi->update_current_user: %s\n" % e) ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -456,7 +457,6 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/UserList.md b/docs/UserList.md index 93e0b95..0e7f014 100644 --- a/docs/UserList.md +++ b/docs/UserList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**users** | [**[User]**](User.md) | | [optional] +**users** | [**List[User]**](User.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.user_list import UserList + +# TODO update the JSON string below +json = "{}" +# create an instance of UserList from a JSON string +user_list_instance = UserList.from_json(json) +# print the JSON string representation of the object +print(UserList.to_json()) + +# convert the object into a dict +user_list_dict = user_list_instance.to_dict() +# create an instance of UserList from a dict +user_list_from_dict = UserList.from_dict(user_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WidgetApi.md b/docs/WidgetApi.md index d9d7ddb..c417d11 100644 --- a/docs/WidgetApi.md +++ b/docs/WidgetApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **get_widget** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} get_widget(id) +> object get_widget(id, params=params) Generate data for a dashboard widget @@ -18,10 +18,10 @@ Generate data for a dashboard widget * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -35,45 +35,38 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_api.WidgetApi(api_client) - id = "id_example" # str | The widget identifier - params = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | The parameters for the widget (optional) + api_instance = ibutsu_client.WidgetApi(api_client) + id = 'id_example' # str | The widget identifier + params = None # object | The parameters for the widget (optional) - # example passing only required values which don't have defaults set - try: - # Generate data for a dashboard widget - api_response = api_instance.get_widget(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling WidgetApi->get_widget: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Generate data for a dashboard widget api_response = api_instance.get_widget(id, params=params) + print("The response of WidgetApi->get_widget:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetApi->get_widget: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The widget identifier | - **params** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| The parameters for the widget | [optional] + **id** | **str**| The widget identifier | + **params** | [**object**](.md)| The parameters for the widget | [optional] ### Return type -**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** +**object** ### Authorization @@ -84,7 +77,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -95,7 +87,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_widget_types** -> WidgetTypeList get_widget_types() +> WidgetTypeList get_widget_types(type=type) Get a list of widget types @@ -106,11 +98,11 @@ A list of widget types * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_api -from ibutsu_client.model.widget_type_list import WidgetTypeList +from ibutsu_client.models.widget_type_list import WidgetTypeList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -124,31 +116,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_api.WidgetApi(api_client) - type = "type_example" # str | Filter by type of widget (optional) + api_instance = ibutsu_client.WidgetApi(api_client) + type = 'type_example' # str | Filter by type of widget (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get a list of widget types api_response = api_instance.get_widget_types(type=type) + print("The response of WidgetApi->get_widget_types:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetApi->get_widget_types: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **type** | **str**| Filter by type of widget | [optional] + **type** | **str**| Filter by type of widget | [optional] ### Return type @@ -163,7 +156,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/WidgetConfig.md b/docs/WidgetConfig.md index 7bd7474..cea562c 100644 --- a/docs/WidgetConfig.md +++ b/docs/WidgetConfig.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The internal ID of the WidgetConfig | [optional] @@ -9,10 +10,26 @@ Name | Type | Description | Notes **widget** | **str** | The widget to render, from the list at /widget/types | [optional] **project_id** | **str** | The project ID for which the widget is designed | [optional] **weight** | **int** | The weighting for the widget, lower weight means it will display first | [optional] -**params** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | A dictionary of parameters to send to the widget | [optional] +**params** | **object** | A dictionary of parameters to send to the widget | [optional] **title** | **str** | The title shown on the widget or page | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.widget_config import WidgetConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of WidgetConfig from a JSON string +widget_config_instance = WidgetConfig.from_json(json) +# print the JSON string representation of the object +print(WidgetConfig.to_json()) + +# convert the object into a dict +widget_config_dict = widget_config_instance.to_dict() +# create an instance of WidgetConfig from a dict +widget_config_from_dict = WidgetConfig.from_dict(widget_config_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WidgetConfigApi.md b/docs/WidgetConfigApi.md index 4ee75b4..6f88246 100644 --- a/docs/WidgetConfigApi.md +++ b/docs/WidgetConfigApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **add_widget_config** -> WidgetConfig add_widget_config() +> WidgetConfig add_widget_config(widget_config=widget_config) Create a widget configuration @@ -21,11 +21,11 @@ Create a widget configuration * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_config_api -from ibutsu_client.model.widget_config import WidgetConfig +from ibutsu_client.models.widget_config import WidgetConfig +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -39,39 +39,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_config_api.WidgetConfigApi(api_client) - widget_config = WidgetConfig( - id="afbcf5c7-1ffd-4367-b228-5a868c29e0ef", - type="widget", - widget="jenkins-heatmap", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - weight=0, - params={}, - title="Job Health", - ) # WidgetConfig | Widget configuration (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.WidgetConfigApi(api_client) + widget_config = ibutsu_client.WidgetConfig() # WidgetConfig | Widget configuration (optional) + try: # Create a widget configuration api_response = api_instance.add_widget_config(widget_config=widget_config) + print("The response of WidgetConfigApi->add_widget_config:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetConfigApi->add_widget_config: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **widget_config** | [**WidgetConfig**](WidgetConfig.md)| Widget configuration | [optional] + **widget_config** | [**WidgetConfig**](WidgetConfig.md)| Widget configuration | [optional] ### Return type @@ -86,7 +79,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -106,10 +98,10 @@ Delete a widget configuration * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_config_api +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -123,29 +115,30 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_config_api.WidgetConfigApi(api_client) - id = "id_example" # str | ID of widget configuration to delete + api_instance = ibutsu_client.WidgetConfigApi(api_client) + id = 'id_example' # str | ID of widget configuration to delete - # example passing only required values which don't have defaults set try: # Delete a widget configuration api_instance.delete_widget_config(id) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetConfigApi->delete_widget_config: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of widget configuration to delete | + **id** | **str**| ID of widget configuration to delete | ### Return type @@ -160,7 +153,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -180,11 +172,11 @@ Get a single widget configuration * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_config_api -from ibutsu_client.model.widget_config import WidgetConfig +from ibutsu_client.models.widget_config import WidgetConfig +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -198,30 +190,32 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_config_api.WidgetConfigApi(api_client) - id = "id_example" # str | ID of widget config to return + api_instance = ibutsu_client.WidgetConfigApi(api_client) + id = 'id_example' # str | ID of widget config to return - # example passing only required values which don't have defaults set try: # Get a single widget configuration api_response = api_instance.get_widget_config(id) + print("The response of WidgetConfigApi->get_widget_config:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetConfigApi->get_widget_config: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of widget config to return | + **id** | **str**| ID of widget config to return | ### Return type @@ -236,7 +230,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -247,7 +240,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_widget_config_list** -> WidgetConfigList get_widget_config_list() +> WidgetConfigList get_widget_config_list(filter=filter, page=page, page_size=page_size) Get the list of widget configurations @@ -258,11 +251,11 @@ A list of widget configurations * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_config_api -from ibutsu_client.model.widget_config_list import WidgetConfigList +from ibutsu_client.models.widget_config_list import WidgetConfigList +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -276,37 +269,36 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_config_api.WidgetConfigApi(api_client) - filter = [ - "filter_example", - ] # [str] | Fields to filter by (optional) - page = 1 # int | Set the page of items to return, defaults to 1 (optional) - page_size = 1 # int | Set the number of items per page, defaults to 25 (optional) - - # example passing only required values which don't have defaults set - # and optional values + api_instance = ibutsu_client.WidgetConfigApi(api_client) + filter = ['filter_example'] # List[str] | Fields to filter by (optional) + page = 56 # int | Set the page of items to return, defaults to 1 (optional) + page_size = 56 # int | Set the number of items per page, defaults to 25 (optional) + try: # Get the list of widget configurations api_response = api_instance.get_widget_config_list(filter=filter, page=page, page_size=page_size) + print("The response of WidgetConfigApi->get_widget_config_list:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetConfigApi->get_widget_config_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | **[str]**| Fields to filter by | [optional] - **page** | **int**| Set the page of items to return, defaults to 1 | [optional] - **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] + **filter** | [**List[str]**](str.md)| Fields to filter by | [optional] + **page** | **int**| Set the page of items to return, defaults to 1 | [optional] + **page_size** | **int**| Set the number of items per page, defaults to 25 | [optional] ### Return type @@ -321,7 +313,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -331,7 +322,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_widget_config** -> WidgetConfig update_widget_config(id) +> WidgetConfig update_widget_config(id, widget_config=widget_config) Updates a single widget configuration @@ -340,11 +331,11 @@ Updates a single widget configuration * Bearer (JWT) Authentication (jwt): ```python -import time import ibutsu_client -from ibutsu_client.api import widget_config_api -from ibutsu_client.model.widget_config import WidgetConfig +from ibutsu_client.models.widget_config import WidgetConfig +from ibutsu_client.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to /api # See configuration.py for a list of all supported configuration parameters. configuration = ibutsu_client.Configuration( @@ -358,49 +349,34 @@ configuration = ibutsu_client.Configuration( # Configure Bearer authorization (JWT): jwt configuration = ibutsu_client.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ibutsu_client.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = widget_config_api.WidgetConfigApi(api_client) - id = "id_example" # str | ID of widget configuration to update - widget_config = WidgetConfig( - id="afbcf5c7-1ffd-4367-b228-5a868c29e0ef", - type="widget", - widget="jenkins-heatmap", - project_id="44941c55-9736-42f6-acce-ca3c4739d0f3", - weight=0, - params={}, - title="Job Health", - ) # WidgetConfig | Widget configuration (optional) - - # example passing only required values which don't have defaults set - try: - # Updates a single widget configuration - api_response = api_instance.update_widget_config(id) - pprint(api_response) - except ibutsu_client.ApiException as e: - print("Exception when calling WidgetConfigApi->update_widget_config: %s\n" % e) + api_instance = ibutsu_client.WidgetConfigApi(api_client) + id = 'id_example' # str | ID of widget configuration to update + widget_config = ibutsu_client.WidgetConfig() # WidgetConfig | Widget configuration (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Updates a single widget configuration api_response = api_instance.update_widget_config(id, widget_config=widget_config) + print("The response of WidgetConfigApi->update_widget_config:\n") pprint(api_response) - except ibutsu_client.ApiException as e: + except Exception as e: print("Exception when calling WidgetConfigApi->update_widget_config: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of widget configuration to update | - **widget_config** | [**WidgetConfig**](WidgetConfig.md)| Widget configuration | [optional] + **id** | **str**| ID of widget configuration to update | + **widget_config** | [**WidgetConfig**](WidgetConfig.md)| Widget configuration | [optional] ### Return type @@ -415,7 +391,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/WidgetConfigList.md b/docs/WidgetConfigList.md index 91e7489..ab4c078 100644 --- a/docs/WidgetConfigList.md +++ b/docs/WidgetConfigList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**widgets** | [**[WidgetConfig]**](WidgetConfig.md) | | [optional] +**widgets** | [**List[WidgetConfig]**](WidgetConfig.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.widget_config_list import WidgetConfigList + +# TODO update the JSON string below +json = "{}" +# create an instance of WidgetConfigList from a JSON string +widget_config_list_instance = WidgetConfigList.from_json(json) +# print the JSON string representation of the object +print(WidgetConfigList.to_json()) + +# convert the object into a dict +widget_config_list_dict = widget_config_list_instance.to_dict() +# create an instance of WidgetConfigList from a dict +widget_config_list_from_dict = WidgetConfigList.from_dict(widget_config_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WidgetParam.md b/docs/WidgetParam.md index 6673e1e..02b6ee0 100644 --- a/docs/WidgetParam.md +++ b/docs/WidgetParam.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the parameter to supply to the widget | [optional] **description** | **str** | A friendly description of the parameter | [optional] **type** | **str** | The type of parameter (string, integer, etc) | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.widget_param import WidgetParam + +# TODO update the JSON string below +json = "{}" +# create an instance of WidgetParam from a JSON string +widget_param_instance = WidgetParam.from_json(json) +# print the JSON string representation of the object +print(WidgetParam.to_json()) + +# convert the object into a dict +widget_param_dict = widget_param_instance.to_dict() +# create an instance of WidgetParam from a dict +widget_param_from_dict = WidgetParam.from_dict(widget_param_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WidgetType.md b/docs/WidgetType.md index 31378c0..fad424e 100644 --- a/docs/WidgetType.md +++ b/docs/WidgetType.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique identifier for this widget type | [optional] **title** | **str** | The title of the widget, for users to see | [optional] **description** | **str** | A helpful description of this widget type | [optional] -**params** | [**[WidgetParam]**](WidgetParam.md) | A dictionary or map of parameters to values | [optional] +**params** | [**List[WidgetParam]**](WidgetParam.md) | A dictionary or map of parameters to values | [optional] **type** | **str** | The type of widget (widget, view) | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.widget_type import WidgetType + +# TODO update the JSON string below +json = "{}" +# create an instance of WidgetType from a JSON string +widget_type_instance = WidgetType.from_json(json) +# print the JSON string representation of the object +print(WidgetType.to_json()) + +# convert the object into a dict +widget_type_dict = widget_type_instance.to_dict() +# create an instance of WidgetType from a dict +widget_type_from_dict = WidgetType.from_dict(widget_type_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WidgetTypeList.md b/docs/WidgetTypeList.md index 5c10e83..16c4063 100644 --- a/docs/WidgetTypeList.md +++ b/docs/WidgetTypeList.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**types** | [**[WidgetType]**](WidgetType.md) | | [optional] +**types** | [**List[WidgetType]**](WidgetType.md) | | [optional] **pagination** | [**Pagination**](Pagination.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from ibutsu_client.models.widget_type_list import WidgetTypeList + +# TODO update the JSON string below +json = "{}" +# create an instance of WidgetTypeList from a JSON string +widget_type_list_instance = WidgetTypeList.from_json(json) +# print the JSON string representation of the object +print(WidgetTypeList.to_json()) + +# convert the object into a dict +widget_type_list_dict = widget_type_list_instance.to_dict() +# create an instance of WidgetTypeList from a dict +widget_type_list_from_dict = WidgetTypeList.from_dict(widget_type_list_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/ibutsu_client/__init__.py b/ibutsu_client/__init__.py index 2534802..39ad941 100644 --- a/ibutsu_client/__init__.py +++ b/ibutsu_client/__init__.py @@ -1,37 +1,245 @@ +# flake8: noqa + """ - Ibutsu API +Ibutsu API A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 -__version__ = "2.3.0" +__version__ = "3.0.0" +# Define package exports __all__ = [ - "ApiAttributeError", + "AdminProjectManagementApi", + "AdminUserManagementApi", + "ArtifactApi", + "DashboardApi", + "GroupApi", + "HealthApi", + "ImportApi", + "LoginApi", + "ProjectApi", + "ReportApi", + "ResultApi", + "RunApi", + "TaskApi", + "UserApi", + "WidgetApi", + "WidgetConfigApi", + "ApiResponse", "ApiClient", - "ApiException", - "ApiKeyError", - "ApiTypeError", - "ApiValueError", "Configuration", "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AccountRecovery", + "AccountRegistration", + "AccountReset", + "Artifact", + "ArtifactList", + "CreateToken", + "Credentials", + "Dashboard", + "DashboardList", + "GetReportTypes200ResponseInner", + "Group", + "GroupList", + "Health", + "HealthInfo", + "LoginConfig", + "LoginError", + "LoginSupport", + "LoginToken", + "ModelImport", + "Pagination", + "Project", + "ProjectList", + "Report", + "ReportList", + "ReportParameters", + "Result", + "ResultList", + "Run", + "RunList", + "Token", + "TokenList", + "UpdateRun", + "User", + "UserList", + "WidgetConfig", + "WidgetConfigList", + "WidgetParam", + "WidgetType", + "WidgetTypeList", ] +if __import__("typing").TYPE_CHECKING: + # import apis into sdk package + from ibutsu_client.api.admin_project_management_api import ( + AdminProjectManagementApi as AdminProjectManagementApi, + ) + from ibutsu_client.api.admin_user_management_api import ( + AdminUserManagementApi as AdminUserManagementApi, + ) + from ibutsu_client.api.artifact_api import ArtifactApi as ArtifactApi + from ibutsu_client.api.dashboard_api import DashboardApi as DashboardApi + from ibutsu_client.api.group_api import GroupApi as GroupApi + from ibutsu_client.api.health_api import HealthApi as HealthApi + from ibutsu_client.api.import_api import ImportApi as ImportApi + from ibutsu_client.api.login_api import LoginApi as LoginApi + from ibutsu_client.api.project_api import ProjectApi as ProjectApi + from ibutsu_client.api.report_api import ReportApi as ReportApi + from ibutsu_client.api.result_api import ResultApi as ResultApi + from ibutsu_client.api.run_api import RunApi as RunApi + from ibutsu_client.api.task_api import TaskApi as TaskApi + from ibutsu_client.api.user_api import UserApi as UserApi + from ibutsu_client.api.widget_api import WidgetApi as WidgetApi + from ibutsu_client.api.widget_config_api import WidgetConfigApi as WidgetConfigApi + + # import ApiClient + from ibutsu_client.api_response import ApiResponse as ApiResponse + from ibutsu_client.api_client import ApiClient as ApiClient + from ibutsu_client.configuration import Configuration as Configuration + from ibutsu_client.exceptions import OpenApiException as OpenApiException + from ibutsu_client.exceptions import ApiTypeError as ApiTypeError + from ibutsu_client.exceptions import ApiValueError as ApiValueError + from ibutsu_client.exceptions import ApiKeyError as ApiKeyError + from ibutsu_client.exceptions import ApiAttributeError as ApiAttributeError + from ibutsu_client.exceptions import ApiException as ApiException + + # import models into sdk package + from ibutsu_client.models.account_recovery import AccountRecovery as AccountRecovery + from ibutsu_client.models.account_registration import ( + AccountRegistration as AccountRegistration, + ) + from ibutsu_client.models.account_reset import AccountReset as AccountReset + from ibutsu_client.models.artifact import Artifact as Artifact + from ibutsu_client.models.artifact_list import ArtifactList as ArtifactList + from ibutsu_client.models.create_token import CreateToken as CreateToken + from ibutsu_client.models.credentials import Credentials as Credentials + from ibutsu_client.models.dashboard import Dashboard as Dashboard + from ibutsu_client.models.dashboard_list import DashboardList as DashboardList + from ibutsu_client.models.get_report_types200_response_inner import ( + GetReportTypes200ResponseInner as GetReportTypes200ResponseInner, + ) + from ibutsu_client.models.group import Group as Group + from ibutsu_client.models.group_list import GroupList as GroupList + from ibutsu_client.models.health import Health as Health + from ibutsu_client.models.health_info import HealthInfo as HealthInfo + from ibutsu_client.models.login_config import LoginConfig as LoginConfig + from ibutsu_client.models.login_error import LoginError as LoginError + from ibutsu_client.models.login_support import LoginSupport as LoginSupport + from ibutsu_client.models.login_token import LoginToken as LoginToken + from ibutsu_client.models.model_import import ModelImport as ModelImport + from ibutsu_client.models.pagination import Pagination as Pagination + from ibutsu_client.models.project import Project as Project + from ibutsu_client.models.project_list import ProjectList as ProjectList + from ibutsu_client.models.report import Report as Report + from ibutsu_client.models.report_list import ReportList as ReportList + from ibutsu_client.models.report_parameters import ReportParameters as ReportParameters + from ibutsu_client.models.result import Result as Result + from ibutsu_client.models.result_list import ResultList as ResultList + from ibutsu_client.models.run import Run as Run + from ibutsu_client.models.run_list import RunList as RunList + from ibutsu_client.models.token import Token as Token + from ibutsu_client.models.token_list import TokenList as TokenList + from ibutsu_client.models.update_run import UpdateRun as UpdateRun + from ibutsu_client.models.user import User as User + from ibutsu_client.models.user_list import UserList as UserList + from ibutsu_client.models.widget_config import WidgetConfig as WidgetConfig + from ibutsu_client.models.widget_config_list import WidgetConfigList as WidgetConfigList + from ibutsu_client.models.widget_param import WidgetParam as WidgetParam + from ibutsu_client.models.widget_type import WidgetType as WidgetType + from ibutsu_client.models.widget_type_list import WidgetTypeList as WidgetTypeList + +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + ("__version__", __version__), + ("__all__", __all__), + """# import apis into sdk package +from ibutsu_client.api.admin_project_management_api import AdminProjectManagementApi as AdminProjectManagementApi +from ibutsu_client.api.admin_user_management_api import AdminUserManagementApi as AdminUserManagementApi +from ibutsu_client.api.artifact_api import ArtifactApi as ArtifactApi +from ibutsu_client.api.dashboard_api import DashboardApi as DashboardApi +from ibutsu_client.api.group_api import GroupApi as GroupApi +from ibutsu_client.api.health_api import HealthApi as HealthApi +from ibutsu_client.api.import_api import ImportApi as ImportApi +from ibutsu_client.api.login_api import LoginApi as LoginApi +from ibutsu_client.api.project_api import ProjectApi as ProjectApi +from ibutsu_client.api.report_api import ReportApi as ReportApi +from ibutsu_client.api.result_api import ResultApi as ResultApi +from ibutsu_client.api.run_api import RunApi as RunApi +from ibutsu_client.api.task_api import TaskApi as TaskApi +from ibutsu_client.api.user_api import UserApi as UserApi +from ibutsu_client.api.widget_api import WidgetApi as WidgetApi +from ibutsu_client.api.widget_config_api import WidgetConfigApi as WidgetConfigApi + # import ApiClient -from ibutsu_client.api_client import ApiClient - -# import Configuration -from ibutsu_client.configuration import Configuration - -# import exceptions -from ibutsu_client.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from ibutsu_client.api_response import ApiResponse as ApiResponse +from ibutsu_client.api_client import ApiClient as ApiClient +from ibutsu_client.configuration import Configuration as Configuration +from ibutsu_client.exceptions import OpenApiException as OpenApiException +from ibutsu_client.exceptions import ApiTypeError as ApiTypeError +from ibutsu_client.exceptions import ApiValueError as ApiValueError +from ibutsu_client.exceptions import ApiKeyError as ApiKeyError +from ibutsu_client.exceptions import ApiAttributeError as ApiAttributeError +from ibutsu_client.exceptions import ApiException as ApiException + +# import models into sdk package +from ibutsu_client.models.account_recovery import AccountRecovery as AccountRecovery +from ibutsu_client.models.account_registration import AccountRegistration as AccountRegistration +from ibutsu_client.models.account_reset import AccountReset as AccountReset +from ibutsu_client.models.artifact import Artifact as Artifact +from ibutsu_client.models.artifact_list import ArtifactList as ArtifactList +from ibutsu_client.models.create_token import CreateToken as CreateToken +from ibutsu_client.models.credentials import Credentials as Credentials +from ibutsu_client.models.dashboard import Dashboard as Dashboard +from ibutsu_client.models.dashboard_list import DashboardList as DashboardList +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner as GetReportTypes200ResponseInner +from ibutsu_client.models.group import Group as Group +from ibutsu_client.models.group_list import GroupList as GroupList +from ibutsu_client.models.health import Health as Health +from ibutsu_client.models.health_info import HealthInfo as HealthInfo +from ibutsu_client.models.login_config import LoginConfig as LoginConfig +from ibutsu_client.models.login_error import LoginError as LoginError +from ibutsu_client.models.login_support import LoginSupport as LoginSupport +from ibutsu_client.models.login_token import LoginToken as LoginToken +from ibutsu_client.models.model_import import ModelImport as ModelImport +from ibutsu_client.models.pagination import Pagination as Pagination +from ibutsu_client.models.project import Project as Project +from ibutsu_client.models.project_list import ProjectList as ProjectList +from ibutsu_client.models.report import Report as Report +from ibutsu_client.models.report_list import ReportList as ReportList +from ibutsu_client.models.report_parameters import ReportParameters as ReportParameters +from ibutsu_client.models.result import Result as Result +from ibutsu_client.models.result_list import ResultList as ResultList +from ibutsu_client.models.run import Run as Run +from ibutsu_client.models.run_list import RunList as RunList +from ibutsu_client.models.token import Token as Token +from ibutsu_client.models.token_list import TokenList as TokenList +from ibutsu_client.models.update_run import UpdateRun as UpdateRun +from ibutsu_client.models.user import User as User +from ibutsu_client.models.user_list import UserList as UserList +from ibutsu_client.models.widget_config import WidgetConfig as WidgetConfig +from ibutsu_client.models.widget_config_list import WidgetConfigList as WidgetConfigList +from ibutsu_client.models.widget_param import WidgetParam as WidgetParam +from ibutsu_client.models.widget_type import WidgetType as WidgetType +from ibutsu_client.models.widget_type_list import WidgetTypeList as WidgetTypeList + +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/ibutsu_client/api/__init__.py b/ibutsu_client/api/__init__.py index 1339efa..e5955f4 100644 --- a/ibutsu_client/api/__init__.py +++ b/ibutsu_client/api/__init__.py @@ -1,3 +1,50 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from ibutsu_client.apis import AdminProjectManagementApi +# flake8: noqa + +if __import__("typing").TYPE_CHECKING: + # import apis into api package + from ibutsu_client.api.admin_project_management_api import AdminProjectManagementApi + from ibutsu_client.api.admin_user_management_api import AdminUserManagementApi + from ibutsu_client.api.artifact_api import ArtifactApi + from ibutsu_client.api.dashboard_api import DashboardApi + from ibutsu_client.api.group_api import GroupApi + from ibutsu_client.api.health_api import HealthApi + from ibutsu_client.api.import_api import ImportApi + from ibutsu_client.api.login_api import LoginApi + from ibutsu_client.api.project_api import ProjectApi + from ibutsu_client.api.report_api import ReportApi + from ibutsu_client.api.result_api import ResultApi + from ibutsu_client.api.run_api import RunApi + from ibutsu_client.api.task_api import TaskApi + from ibutsu_client.api.user_api import UserApi + from ibutsu_client.api.widget_api import WidgetApi + from ibutsu_client.api.widget_config_api import WidgetConfigApi + +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + """# import apis into api package +from ibutsu_client.api.admin_project_management_api import AdminProjectManagementApi +from ibutsu_client.api.admin_user_management_api import AdminUserManagementApi +from ibutsu_client.api.artifact_api import ArtifactApi +from ibutsu_client.api.dashboard_api import DashboardApi +from ibutsu_client.api.group_api import GroupApi +from ibutsu_client.api.health_api import HealthApi +from ibutsu_client.api.import_api import ImportApi +from ibutsu_client.api.login_api import LoginApi +from ibutsu_client.api.project_api import ProjectApi +from ibutsu_client.api.report_api import ReportApi +from ibutsu_client.api.result_api import ResultApi +from ibutsu_client.api.run_api import RunApi +from ibutsu_client.api.task_api import TaskApi +from ibutsu_client.api.user_api import UserApi +from ibutsu_client.api.widget_api import WidgetApi +from ibutsu_client.api.widget_config_api import WidgetConfigApi + +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/ibutsu_client/api/admin_project_management_api.py b/ibutsu_client/api/admin_project_management_api.py index 5cd310e..7d5374f 100644 --- a/ibutsu_client/api/admin_project_management_api.py +++ b/ibutsu_client/api/admin_project_management_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.project import Project -from ibutsu_client.model.project_list import ProjectList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.project import Project +from ibutsu_client.models.project_list import ProjectList +from ibutsu_client.rest import RESTResponseType class AdminProjectManagementApi: @@ -20,517 +28,1213 @@ class AdminProjectManagementApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.admin_add_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/admin/project", - "operation_id": "admin_add_project", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "project", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "project": (Project,), - }, - "attribute_map": {}, - "location_map": { - "project": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def admin_add_project( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Administration endpoint to manually add a project. Only accessible to superadmins. + + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_delete_project_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/admin/project/{id}", - "operation_id": "admin_delete_project", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_add_project_with_http_info( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Administration endpoint to manually add a project. Only accessible to superadmins. + + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_get_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/admin/project/{id}", - "operation_id": "admin_get_project", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.admin_get_project_list_endpoint = _Endpoint( - settings={ - "response_type": (ProjectList,), - "auth": ["jwt"], - "endpoint_path": "/admin/project", - "operation_id": "admin_get_project_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def admin_add_project_without_preload_content( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to manually add a project. Only accessible to superadmins. + + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_update_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/admin/project/{id}", - "operation_id": "admin_update_project", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "project", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "project": (Project,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "project": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_add_project_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/admin/project", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - def admin_add_project(self, **kwargs): - """Administration endpoint to manually add a project. Only accessible to superadmins. + @validate_call + def admin_delete_project( + self, + id: Annotated[UUID, Field(description="The ID of the project to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Administration endpoint to delete a project. Only accessible to superadmins. + - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_add_project(async_req=True) - >>> result = thread.get() - - - Keyword Args: - project (Project): A project. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + :param id: The ID of the project to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.admin_add_project_endpoint.call_with_http_info(**kwargs) - - def admin_delete_project(self, id, **kwargs): + + _param = self._admin_delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_delete_project_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the project to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: """Administration endpoint to delete a project. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_delete_project(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the project to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the project to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_delete_project_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the project to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to delete a project. Only accessible to superadmins. + + + :param id: The ID of the project to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_delete_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_delete_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/admin/project/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_get_project( + self, + id: Annotated[UUID, Field(description="The id of a project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Administration endpoint to return a project. Only accessible to superadmins. + + + :param id: The id of a project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_delete_project_endpoint.call_with_http_info(**kwargs) - - def admin_get_project(self, id, **kwargs): + + _param = self._admin_get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_get_project_with_http_info( + self, + id: Annotated[UUID, Field(description="The id of a project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: """Administration endpoint to return a project. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_get_project(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The id of a project - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + + :param id: The id of a project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_get_project_endpoint.call_with_http_info(**kwargs) - - def admin_get_project_list(self, **kwargs): + + _param = self._admin_get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_get_project_without_preload_content( + self, + id: Annotated[UUID, Field(description="The id of a project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to return a project. Only accessible to superadmins. + + + :param id: The id of a project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_get_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/admin/project/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_get_project_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectList: + """Administration endpoint to return a list of projects. Only accessible to superadmins. + + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_project_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_get_project_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectList]: """Administration endpoint to return a list of projects. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_get_project_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ProjectList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_project_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_get_project_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to return a list of projects. Only accessible to superadmins. + + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_project_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_get_project_list_serialize( + self, + filter, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/admin/project", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_update_project( + self, + id: Annotated[UUID, Field(description="The ID of the project to update")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Administration endpoint to update a project. Only accessible to superadmins. + + + :param id: The ID of the project to update (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_update_project_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the project to update")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Administration endpoint to update a project. Only accessible to superadmins. + + + :param id: The ID of the project to update (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.admin_get_project_list_endpoint.call_with_http_info(**kwargs) - - def admin_update_project(self, id, **kwargs): + + _param = self._admin_update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_update_project_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the project to update")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Administration endpoint to update a project. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_update_project(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the project to update - - Keyword Args: - project (Project): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the project to update (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_update_project_endpoint.call_with_http_info(**kwargs) + + _param = self._admin_update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_update_project_serialize( + self, + id, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/admin/project/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/admin_user_management_api.py b/ibutsu_client/api/admin_user_management_api.py index c678ac1..18824fa 100644 --- a/ibutsu_client/api/admin_user_management_api.py +++ b/ibutsu_client/api/admin_user_management_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.user import User -from ibutsu_client.model.user_list import UserList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.user import User +from ibutsu_client.models.user_list import UserList +from ibutsu_client.rest import RESTResponseType class AdminUserManagementApi: @@ -20,517 +28,1213 @@ class AdminUserManagementApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.admin_add_user_endpoint = _Endpoint( - settings={ - "response_type": (User,), - "auth": ["jwt"], - "endpoint_path": "/admin/user", - "operation_id": "admin_add_user", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "user", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "user": (User,), - }, - "attribute_map": {}, - "location_map": { - "user": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def admin_add_user( + self, + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Administration endpoint to manually add a user. Only accessible to superadmins. + + + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_delete_user_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/admin/user/{id}", - "operation_id": "admin_delete_user", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "User", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_add_user_with_http_info( + self, + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Administration endpoint to manually add a user. Only accessible to superadmins. + + + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_get_user_endpoint = _Endpoint( - settings={ - "response_type": (User,), - "auth": ["jwt"], - "endpoint_path": "/admin/user/{id}", - "operation_id": "admin_get_user", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "User", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.admin_get_user_list_endpoint = _Endpoint( - settings={ - "response_type": (UserList,), - "auth": ["jwt"], - "endpoint_path": "/admin/user", - "operation_id": "admin_get_user_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def admin_add_user_without_preload_content( + self, + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to manually add a user. Only accessible to superadmins. + + + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_add_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.admin_update_user_endpoint = _Endpoint( - settings={ - "response_type": (User,), - "auth": ["jwt"], - "endpoint_path": "/admin/user/{id}", - "operation_id": "admin_update_user", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "user", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "user": (User,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "user": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "User", + "400": None, + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_add_user_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/admin/user", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - def admin_add_user(self, **kwargs): - """Administration endpoint to manually add a user. Only accessible to superadmins. + @validate_call + def admin_delete_user( + self, + id: Annotated[UUID, Field(description="The ID of the user to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Administration endpoint to delete a user. Only accessible to superadmins. + - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_add_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - user (User): A user. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. + :param id: The ID of the user to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.admin_add_user_endpoint.call_with_http_info(**kwargs) - - def admin_delete_user(self, id, **kwargs): + + _param = self._admin_delete_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_delete_user_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the user to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: """Administration endpoint to delete a user. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_delete_user(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the user to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the user to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_delete_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_delete_user_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the user to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to delete a user. Only accessible to superadmins. + + + :param id: The ID of the user to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_delete_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_delete_user_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/admin/user/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_get_user( + self, + id: Annotated[StrictStr, Field(description="The id of a user")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Administration endpoint to return a user. Only accessible to superadmins. + + + :param id: The id of a user (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_delete_user_endpoint.call_with_http_info(**kwargs) - - def admin_get_user(self, id, **kwargs): + + _param = self._admin_get_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_get_user_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The id of a user")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: """Administration endpoint to return a user. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_get_user(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The id of a user - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. + + :param id: The id of a user (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_get_user_endpoint.call_with_http_info(**kwargs) - - def admin_get_user_list(self, **kwargs): + + _param = self._admin_get_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_get_user_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The id of a user")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to return a user. Only accessible to superadmins. + + + :param id: The id of a user (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_user_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_get_user_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/admin/user/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_get_user_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserList: + """Administration endpoint to return a list of users. Only accessible to superadmins. + + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_user_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "UserList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_get_user_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserList]: """Administration endpoint to return a list of users. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_get_user_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UserList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_user_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "UserList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_get_user_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Administration endpoint to return a list of users. Only accessible to superadmins. + + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_get_user_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "UserList", + "401": None, + "403": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_get_user_list_serialize( + self, + filter, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/admin/user", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def admin_update_user( + self, + id: Annotated[UUID, Field(description="The ID of the user to update")], + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Administration endpoint to update a user. Only accessible to superadmins. + + + :param id: The ID of the user to update (required) + :type id: str + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._admin_update_user_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def admin_update_user_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the user to update")], + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Administration endpoint to update a user. Only accessible to superadmins. + + + :param id: The ID of the user to update (required) + :type id: str + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.admin_get_user_list_endpoint.call_with_http_info(**kwargs) - - def admin_update_user(self, id, **kwargs): + + _param = self._admin_update_user_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def admin_update_user_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the user to update")], + user: Annotated[User | None, Field(description="A user object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Administration endpoint to update a user. Only accessible to superadmins. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.admin_update_user(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the user to update - - Keyword Args: - user (User): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the user to update (required) + :type id: str + :param user: A user object + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.admin_update_user_endpoint.call_with_http_info(**kwargs) + + _param = self._admin_update_user_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "400": None, + "401": None, + "403": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _admin_update_user_serialize( + self, + id, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user is not None: + _body_params = user + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/admin/user/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/artifact_api.py b/ibutsu_client/api/artifact_api.py index d43a717..a9b0a62 100644 --- a/ibutsu_client/api/artifact_api.py +++ b/ibutsu_client/api/artifact_api.py @@ -3,20 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.artifact import Artifact -from ibutsu_client.model.artifact_list import ArtifactList -from ibutsu_client.model_utils import ( - date, - datetime, - file_type, - none_type, -) +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictBytes, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.artifact import Artifact +from ibutsu_client.models.artifact_list import ArtifactList +from ibutsu_client.rest import RESTResponseType class ArtifactApi: @@ -26,663 +28,1479 @@ class ArtifactApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.delete_artifact_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/artifact/{id}", - "operation_id": "delete_artifact", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def delete_artifact( + self, + id: Annotated[UUID, Field(description="ID of artifact to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an artifact + + + :param id: ID of artifact to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.download_artifact_endpoint = _Endpoint( - settings={ - "response_type": (file_type,), - "auth": ["jwt"], - "endpoint_path": "/artifact/{id}/download", - "operation_id": "download_artifact", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [ - "text/plain", - "image/jpeg", - "image/png", - "image/gif", - "application/octet-stream", - ], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_artifact_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of artifact to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an artifact + + + :param id: ID of artifact to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_artifact_endpoint = _Endpoint( - settings={ - "response_type": (Artifact,), - "auth": ["jwt"], - "endpoint_path": "/artifact/{id}", - "operation_id": "get_artifact", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.get_artifact_list_endpoint = _Endpoint( - settings={ - "response_type": (ArtifactList,), - "auth": ["jwt"], - "endpoint_path": "/artifact", - "operation_id": "get_artifact_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "result_id", - "run_id", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "result_id": (str,), - "run_id": (str,), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "result_id": "resultId", - "run_id": "runId", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "result_id": "query", - "run_id": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def delete_artifact_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of artifact to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an artifact + + + :param id: ID of artifact to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.upload_artifact_endpoint = _Endpoint( - settings={ - "response_type": (Artifact,), - "auth": ["jwt"], - "endpoint_path": "/artifact", - "operation_id": "upload_artifact", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "filename", - "file", - "result_id", - "run_id", - "additional_metadata", - ], - "required": [ - "filename", - "file", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filename": (str,), - "file": (file_type,), - "result_id": (str,), - "run_id": (str,), - "additional_metadata": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - }, - "attribute_map": { - "filename": "filename", - "file": "file", - "result_id": "resultId", - "run_id": "runId", - "additional_metadata": "additionalMetadata", - }, - "location_map": { - "filename": "form", - "file": "form", - "result_id": "form", - "run_id": "form", - "additional_metadata": "form", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["multipart/form-data"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_artifact_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/artifact/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - self.view_artifact_endpoint = _Endpoint( - settings={ - "response_type": (file_type,), - "auth": ["jwt"], - "endpoint_path": "/artifact/{id}/view", - "operation_id": "view_artifact", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [ - "text/plain", - "image/jpeg", - "image/png", - "image/gif", - "application/octet-stream", - ], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def download_artifact( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Download an artifact + + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._download_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - def delete_artifact(self, id, **kwargs): - """Delete an artifact + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def download_artifact_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Download an artifact + - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_artifact(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of artifact to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.delete_artifact_endpoint.call_with_http_info(**kwargs) - - def download_artifact(self, id, **kwargs): + + _param = self._download_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def download_artifact_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Download an artifact - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.download_artifact(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of artifact to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.download_artifact_endpoint.call_with_http_info(**kwargs) - - def get_artifact(self, id, **kwargs): + + _param = self._download_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _download_artifact_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain", "image/jpeg", "image/png", "image/gif", "application/octet-stream"] + ) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/artifact/{id}/download", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_artifact( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Artifact: """Get a single artifact - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_artifact(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of artifact to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Artifact - If the method is called asynchronously, returns the request - thread. + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Artifact", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_artifact_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Artifact]: + """Get a single artifact + + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Artifact", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_artifact_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a single artifact + + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Artifact", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_artifact_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/artifact/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_artifact_list( + self, + result_id: Annotated[UUID | None, Field(description="The result ID to filter by")] = None, + run_id: Annotated[UUID | None, Field(description="The run ID to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactList: + """Get a (filtered) list of artifacts + + + :param result_id: The result ID to filter by + :type result_id: str + :param run_id: The run ID to filter by + :type run_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_artifact_endpoint.call_with_http_info(**kwargs) - - def get_artifact_list(self, **kwargs): + + _param = self._get_artifact_list_serialize( + result_id=result_id, + run_id=run_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ArtifactList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_artifact_list_with_http_info( + self, + result_id: Annotated[UUID | None, Field(description="The result ID to filter by")] = None, + run_id: Annotated[UUID | None, Field(description="The run ID to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactList]: """Get a (filtered) list of artifacts - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_artifact_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - result_id (str): The result ID to filter by. [optional] - run_id (str): The run ID to filter by. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ArtifactList - If the method is called asynchronously, returns the request - thread. + + :param result_id: The result ID to filter by + :type result_id: str + :param run_id: The run ID to filter by + :type run_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_artifact_list_serialize( + result_id=result_id, + run_id=run_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ArtifactList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_artifact_list_without_preload_content( + self, + result_id: Annotated[UUID | None, Field(description="The result ID to filter by")] = None, + run_id: Annotated[UUID | None, Field(description="The run ID to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a (filtered) list of artifacts + + + :param result_id: The result ID to filter by + :type result_id: str + :param run_id: The run ID to filter by + :type run_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_artifact_list_serialize( + result_id=result_id, + run_id=run_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ArtifactList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_artifact_list_serialize( + self, + result_id, + run_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if result_id is not None: + _query_params.append(("resultId", result_id)) + + if run_id is not None: + _query_params.append(("runId", run_id)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/artifact", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def upload_artifact( + self, + filename: Annotated[StrictStr, Field(description="name of the file")], + file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="file to upload"), + ], + result_id: Annotated[ + UUID | None, Field(description="ID of result to attach artifact to") + ] = None, + run_id: Annotated[ + UUID | None, Field(description="ID of run to attach artifact to") + ] = None, + additional_metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional data to pass to server") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Artifact: + """Uploads a test run artifact + + + :param filename: name of the file (required) + :type filename: str + :param file: file to upload (required) + :type file: bytearray + :param result_id: ID of result to attach artifact to + :type result_id: str + :param run_id: ID of run to attach artifact to + :type run_id: str + :param additional_metadata: Additional data to pass to server + :type additional_metadata: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_artifact_list_endpoint.call_with_http_info(**kwargs) - - def upload_artifact(self, filename, file, **kwargs): + + _param = self._upload_artifact_serialize( + filename=filename, + file=file, + result_id=result_id, + run_id=run_id, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Artifact", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def upload_artifact_with_http_info( + self, + filename: Annotated[StrictStr, Field(description="name of the file")], + file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="file to upload"), + ], + result_id: Annotated[ + UUID | None, Field(description="ID of result to attach artifact to") + ] = None, + run_id: Annotated[ + UUID | None, Field(description="ID of run to attach artifact to") + ] = None, + additional_metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional data to pass to server") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Artifact]: """Uploads a test run artifact - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upload_artifact(filename, file, async_req=True) - >>> result = thread.get() - - Args: - filename (str): ID of pet to update - file (file_type): file to upload - - Keyword Args: - result_id (str): ID of result to attach artifact to. [optional] - run_id (str): ID of run to attach artifact to. [optional] - additional_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional data to pass to server. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Artifact - If the method is called asynchronously, returns the request - thread. + + :param filename: name of the file (required) + :type filename: str + :param file: file to upload (required) + :type file: bytearray + :param result_id: ID of result to attach artifact to + :type result_id: str + :param run_id: ID of run to attach artifact to + :type run_id: str + :param additional_metadata: Additional data to pass to server + :type additional_metadata: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["filename"] = filename - kwargs["file"] = file - return self.upload_artifact_endpoint.call_with_http_info(**kwargs) - - def view_artifact(self, id, **kwargs): + + _param = self._upload_artifact_serialize( + filename=filename, + file=file, + result_id=result_id, + run_id=run_id, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Artifact", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def upload_artifact_without_preload_content( + self, + filename: Annotated[StrictStr, Field(description="name of the file")], + file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="file to upload"), + ], + result_id: Annotated[ + UUID | None, Field(description="ID of result to attach artifact to") + ] = None, + run_id: Annotated[ + UUID | None, Field(description="ID of run to attach artifact to") + ] = None, + additional_metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional data to pass to server") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Uploads a test run artifact + + + :param filename: name of the file (required) + :type filename: str + :param file: file to upload (required) + :type file: bytearray + :param result_id: ID of result to attach artifact to + :type result_id: str + :param run_id: ID of run to attach artifact to + :type run_id: str + :param additional_metadata: Additional data to pass to server + :type additional_metadata: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._upload_artifact_serialize( + filename=filename, + file=file, + result_id=result_id, + run_id=run_id, + additional_metadata=additional_metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Artifact", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _upload_artifact_serialize( + self, + filename, + file, + result_id, + run_id, + additional_metadata, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if result_id is not None: + _form_params.append(("resultId", result_id)) + if run_id is not None: + _form_params.append(("runId", run_id)) + if filename is not None: + _form_params.append(("filename", filename)) + if file is not None: + _files["file"] = file + if additional_metadata is not None: + _form_params.append(("additionalMetadata", additional_metadata)) + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/artifact", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def view_artifact( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: """Stream an artifact directly to the client/browser - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.view_artifact(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of artifact to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.view_artifact_endpoint.call_with_http_info(**kwargs) + + _param = self._view_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def view_artifact_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Stream an artifact directly to the client/browser + + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._view_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def view_artifact_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of artifact to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Stream an artifact directly to the client/browser + + + :param id: ID of artifact to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._view_artifact_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _view_artifact_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["text/plain", "image/jpeg", "image/png", "image/gif", "application/octet-stream"] + ) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/artifact/{id}/view", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/dashboard_api.py b/ibutsu_client/api/dashboard_api.py index e07a258..3135db3 100644 --- a/ibutsu_client/api/dashboard_api.py +++ b/ibutsu_client/api/dashboard_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.dashboard import Dashboard -from ibutsu_client.model.dashboard_list import DashboardList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.models.dashboard_list import DashboardList +from ibutsu_client.rest import RESTResponseType class DashboardApi: @@ -20,531 +28,1227 @@ class DashboardApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_dashboard_endpoint = _Endpoint( - settings={ - "response_type": (Dashboard,), - "auth": ["jwt"], - "endpoint_path": "/dashboard", - "operation_id": "add_dashboard", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "dashboard", - ], - "required": [ - "dashboard", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "dashboard": (Dashboard,), - }, - "attribute_map": {}, - "location_map": { - "dashboard": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def add_dashboard( + self, + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dashboard: + """Create a dashboard + + + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_dashboard_serialize( + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.delete_dashboard_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/dashboard/{id}", - "operation_id": "delete_dashboard", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Dashboard", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_dashboard_with_http_info( + self, + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dashboard]: + """Create a dashboard + + + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_dashboard_serialize( + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_dashboard_endpoint = _Endpoint( - settings={ - "response_type": (Dashboard,), - "auth": ["jwt"], - "endpoint_path": "/dashboard/{id}", - "operation_id": "get_dashboard", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Dashboard", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.get_dashboard_list_endpoint = _Endpoint( - settings={ - "response_type": (DashboardList,), - "auth": ["jwt"], - "endpoint_path": "/dashboard", - "operation_id": "get_dashboard_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "project_id", - "user_id", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "project_id": (str,), - "user_id": (str,), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "project_id": "project_id", - "user_id": "user_id", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "project_id": "query", - "user_id": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_dashboard_without_preload_content( + self, + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a dashboard + + + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_dashboard_serialize( + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.update_dashboard_endpoint = _Endpoint( - settings={ - "response_type": (Dashboard,), - "auth": ["jwt"], - "endpoint_path": "/dashboard/{id}", - "operation_id": "update_dashboard", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "dashboard", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "dashboard": (Dashboard,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "dashboard": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Dashboard", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_dashboard_serialize( + self, + dashboard, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dashboard is not None: + _body_params = dashboard + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/dashboard", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - def add_dashboard(self, dashboard, **kwargs): - """Create a dashboard + @validate_call + def delete_dashboard( + self, + id: Annotated[UUID, Field(description="ID of dashboard to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a dashboard + + + :param id: ID of dashboard to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_dashboard(dashboard, async_req=True) - >>> result = thread.get() - - Args: - dashboard (Dashboard): Dashboard - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Dashboard - If the method is called asynchronously, returns the request - thread. + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_dashboard_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of dashboard to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a dashboard + + + :param id: ID of dashboard to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["dashboard"] = dashboard - return self.add_dashboard_endpoint.call_with_http_info(**kwargs) - - def delete_dashboard(self, id, **kwargs): + + _param = self._delete_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_dashboard_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of dashboard to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Delete a dashboard - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_dashboard(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of dashboard to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param id: ID of dashboard to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.delete_dashboard_endpoint.call_with_http_info(**kwargs) - - def get_dashboard(self, id, **kwargs): + + _param = self._delete_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_dashboard_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/dashboard/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_dashboard( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dashboard: + """Get a single dashboard by ID + + + :param id: ID of test dashboard (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_dashboard_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dashboard]: """Get a single dashboard by ID - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_dashboard(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of test dashboard - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Dashboard - If the method is called asynchronously, returns the request - thread. + + :param id: ID of test dashboard (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_dashboard_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a single dashboard by ID + + + :param id: ID of test dashboard (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_dashboard_endpoint.call_with_http_info(**kwargs) - - def get_dashboard_list(self, **kwargs): + + _param = self._get_dashboard_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_dashboard_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/dashboard/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_dashboard_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + project_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by project ID") + ] = None, + user_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by user ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DashboardList: """Get a list of dashboards - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_dashboard_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - project_id (str): Filter dashboards by project ID. [optional] - user_id (str): Filter dashboards by user ID. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DashboardList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param project_id: Filter dashboards by project ID + :type project_id: str + :param user_id: Filter dashboards by user ID + :type user_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_dashboard_list_endpoint.call_with_http_info(**kwargs) - - def update_dashboard(self, id, **kwargs): + + _param = self._get_dashboard_list_serialize( + filter=filter, + project_id=project_id, + user_id=user_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "DashboardList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_dashboard_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + project_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by project ID") + ] = None, + user_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by user ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DashboardList]: + """Get a list of dashboards + + + :param filter: Fields to filter by + :type filter: List[str] + :param project_id: Filter dashboards by project ID + :type project_id: str + :param user_id: Filter dashboards by user ID + :type user_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_dashboard_list_serialize( + filter=filter, + project_id=project_id, + user_id=user_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "DashboardList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_dashboard_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + project_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by project ID") + ] = None, + user_id: Annotated[ + StrictStr | None, Field(description="Filter dashboards by user ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of dashboards + + + :param filter: Fields to filter by + :type filter: List[str] + :param project_id: Filter dashboards by project ID + :type project_id: str + :param user_id: Filter dashboards by user ID + :type user_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_dashboard_list_serialize( + filter=filter, + project_id=project_id, + user_id=user_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "DashboardList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_dashboard_list_serialize( + self, + filter, + project_id, + user_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if project_id is not None: + _query_params.append(("project_id", project_id)) + + if user_id is not None: + _query_params.append(("user_id", user_id)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/dashboard", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_dashboard( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dashboard: + """Update a dashboard + + + :param id: ID of test dashboard (required) + :type id: str + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_dashboard_serialize( + id=id, + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_dashboard_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dashboard]: + """Update a dashboard + + + :param id: ID of test dashboard (required) + :type id: str + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_dashboard_serialize( + id=id, + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_dashboard_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of test dashboard")], + dashboard: Annotated[Dashboard | None, Field(description="A dashboard object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Update a dashboard - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_dashboard(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of test dashboard - - Keyword Args: - dashboard (Dashboard): Dashboard. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Dashboard - If the method is called asynchronously, returns the request - thread. + + :param id: ID of test dashboard (required) + :type id: str + :param dashboard: A dashboard object + :type dashboard: Dashboard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.update_dashboard_endpoint.call_with_http_info(**kwargs) + + _param = self._update_dashboard_serialize( + id=id, + dashboard=dashboard, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Dashboard", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_dashboard_serialize( + self, + id, + dashboard, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if dashboard is not None: + _body_params = dashboard + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/dashboard/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/group_api.py b/ibutsu_client/api/group_api.py index 2d784aa..b63bd01 100644 --- a/ibutsu_client/api/group_api.py +++ b/ibutsu_client/api/group_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.group import Group -from ibutsu_client.model.group_list import GroupList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.group import Group +from ibutsu_client.models.group_list import GroupList +from ibutsu_client.rest import RESTResponseType class GroupApi: @@ -20,414 +28,950 @@ class GroupApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_group_endpoint = _Endpoint( - settings={ - "response_type": (Group,), - "auth": ["jwt"], - "endpoint_path": "/group", - "operation_id": "add_group", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "group", - ], - "required": [ - "group", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "group": (Group,), - }, - "attribute_map": {}, - "location_map": { - "group": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.get_group_endpoint = _Endpoint( - settings={ - "response_type": (Group,), - "auth": ["jwt"], - "endpoint_path": "/group/{id}", - "operation_id": "get_group", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_group( + self, + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """Create a new group + + + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_group_list_endpoint = _Endpoint( - settings={ - "response_type": (GroupList,), - "auth": ["jwt"], - "endpoint_path": "/group", - "operation_id": "get_group_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "page": "query", - "page_size": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Group", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_group_with_http_info( + self, + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: + """Create a new group + + + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.update_group_endpoint = _Endpoint( - settings={ - "response_type": (Group,), - "auth": ["jwt"], - "endpoint_path": "/group/{id}", - "operation_id": "update_group", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "group", - ], - "required": [ - "id", - "group", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "group": (Group,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "group": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Group", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - def add_group(self, group, **kwargs): + @validate_call + def add_group_without_preload_content( + self, + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Create a new group - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_group(group, async_req=True) - >>> result = thread.get() - - Args: - group (Group): The group - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Group - If the method is called asynchronously, returns the request - thread. + + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Group", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_group_serialize( + self, + group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if group is not None: + _body_params = group + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/group", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_group( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """Get a group + + + :param id: The ID of the group (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["group"] = group - return self.add_group_endpoint.call_with_http_info(**kwargs) - - def get_group(self, id, **kwargs): + + _param = self._get_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_group_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: """Get a group - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_group(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the group - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Group - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the group (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_group_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a group + + + :param id: The ID of the group (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_group_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_group_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/group/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_group_list( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupList: + """Get a list of groups + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_group_endpoint.call_with_http_info(**kwargs) - - def get_group_list(self, **kwargs): + + _param = self._get_group_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "GroupList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_group_list_with_http_info( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupList]: """Get a list of groups - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_group_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - GroupList - If the method is called asynchronously, returns the request - thread. + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_group_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "GroupList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_group_list_without_preload_content( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of groups + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_group_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "GroupList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_group_list_serialize( + self, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/group", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_group( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Group: + """Update a group + + + :param id: The ID of the group (required) + :type id: str + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_group_list_endpoint.call_with_http_info(**kwargs) - - def update_group(self, id, group, **kwargs): + + _param = self._update_group_serialize( + id=id, + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_group_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Group]: """Update a group - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_group(id, group, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the group - group (Group): The updated group - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Group - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the group (required) + :type id: str + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - kwargs["group"] = group - return self.update_group_endpoint.call_with_http_info(**kwargs) + + _param = self._update_group_serialize( + id=id, + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_group_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the group")], + group: Annotated[Group | None, Field(description="A group object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a group + + + :param id: The ID of the group (required) + :type id: str + :param group: A group object + :type group: Group + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_group_serialize( + id=id, + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Group", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_group_serialize( + self, + id, + group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if group is not None: + _body_params = group + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/group/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/health_api.py b/ibutsu_client/api/health_api.py index 0fa1a43..8488a81 100644 --- a/ibutsu_client/api/health_api.py +++ b/ibutsu_client/api/health_api.py @@ -3,14 +3,21 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.health import Health -from ibutsu_client.model.health_info import HealthInfo +from typing import Annotated, Any + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.health import Health +from ibutsu_client.models.health_info import HealthInfo +from ibutsu_client.rest import RESTResponseType class HealthApi: @@ -20,256 +27,613 @@ class HealthApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_database_health_endpoint = _Endpoint( - settings={ - "response_type": (Health,), - "auth": ["jwt"], - "endpoint_path": "/health/database", - "operation_id": "get_database_health", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def get_database_health( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Health: + """Get a health report for the database + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_database_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_health_endpoint = _Endpoint( - settings={ - "response_type": (Health,), - "auth": ["jwt"], - "endpoint_path": "/health", - "operation_id": "get_health", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": "Health", + "500": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_database_health_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Health]: + """Get a health report for the database + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_database_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_health_info_endpoint = _Endpoint( - settings={ - "response_type": (HealthInfo,), - "auth": ["jwt"], - "endpoint_path": "/health/info", - "operation_id": "get_health_info", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": "Health", + "500": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - def get_database_health(self, **kwargs): + @validate_call + def get_database_health_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a health report for the database - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_database_health(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Health - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_database_health_endpoint.call_with_http_info(**kwargs) - - def get_health(self, **kwargs): + + _param = self._get_database_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Health", + "500": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_database_health_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/health/database", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_health( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Health: + """Get a general health report + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_health_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Health]: """Get a general health report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_health(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Health - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_health_endpoint.call_with_http_info(**kwargs) - - def get_health_info(self, **kwargs): + + _param = self._get_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_health_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a general health report + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_health_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Health", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_health_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/health", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_health_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthInfo: + """Get information about the server + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_health_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "HealthInfo", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_health_info_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthInfo]: """Get information about the server - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_health_info(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - HealthInfo - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_health_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "HealthInfo", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_health_info_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get information about the server + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_health_info_endpoint.call_with_http_info(**kwargs) + + _param = self._get_health_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "HealthInfo", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_health_info_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/health/info", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/import_api.py b/ibutsu_client/api/import_api.py index 44e6a9f..9c6d0bb 100644 --- a/ibutsu_client/api/import_api.py +++ b/ibutsu_client/api/import_api.py @@ -3,19 +3,21 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.model_import import ModelImport -from ibutsu_client.model_utils import ( - date, - datetime, - file_type, - none_type, -) +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictBytes, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.model_import import ModelImport +from ibutsu_client.rest import RESTResponseType class ImportApi: @@ -25,225 +27,527 @@ class ImportApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_import_endpoint = _Endpoint( - settings={ - "response_type": (ModelImport,), - "auth": ["jwt"], - "endpoint_path": "/import", - "operation_id": "add_import", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "import_file", - "project", - "metadata", - "source", - ], - "required": [ - "import_file", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "import_file": (file_type,), - "project": (str,), - "metadata": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "source": (str,), - }, - "attribute_map": { - "import_file": "importFile", - "project": "project", - "metadata": "metadata", - "source": "source", - }, - "location_map": { - "import_file": "form", - "project": "form", - "metadata": "form", - "source": "form", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["multipart/form-data"]}, - api_client=api_client, + + @validate_call + def add_import( + self, + import_file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="The file to import"), + ], + project: Annotated[ + StrictStr | None, Field(description="The project associated with this import") + ] = None, + metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional metadata about imported run") + ] = None, + source: Annotated[StrictStr | None, Field(description="The source of this import")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelImport: + """Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive + + + :param import_file: The file to import (required) + :type import_file: bytearray + :param project: The project associated with this import + :type project: str + :param metadata: Additional metadata about imported run + :type metadata: object + :param source: The source of this import + :type source: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_import_serialize( + import_file=import_file, + project=project, + metadata=metadata, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_import_endpoint = _Endpoint( - settings={ - "response_type": (ModelImport,), - "auth": ["jwt"], - "endpoint_path": "/import/{id}", - "operation_id": "get_import", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "ModelImport", + "400": None, + "415": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_import_with_http_info( + self, + import_file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="The file to import"), + ], + project: Annotated[ + StrictStr | None, Field(description="The project associated with this import") + ] = None, + metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional metadata about imported run") + ] = None, + source: Annotated[StrictStr | None, Field(description="The source of this import")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelImport]: + """Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive + + + :param import_file: The file to import (required) + :type import_file: bytearray + :param project: The project associated with this import + :type project: str + :param metadata: Additional metadata about imported run + :type metadata: object + :param source: The source of this import + :type source: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_import_serialize( + import_file=import_file, + project=project, + metadata=metadata, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - def add_import(self, import_file, **kwargs): + _response_types_map: dict[str, str | None] = { + "201": "ModelImport", + "400": None, + "415": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def add_import_without_preload_content( + self, + import_file: Annotated[ + StrictBytes | StrictStr | tuple[StrictStr, StrictBytes], + Field(description="The file to import"), + ], + project: Annotated[ + StrictStr | None, Field(description="The project associated with this import") + ] = None, + metadata: Annotated[ + dict[str, Any] | None, Field(description="Additional metadata about imported run") + ] = None, + source: Annotated[StrictStr | None, Field(description="The source of this import")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_import(import_file, async_req=True) - >>> result = thread.get() - - Args: - import_file (file_type): The file to import - - Keyword Args: - project (str): The project associated with this import. [optional] - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional metadata about imported run. [optional] - source (str): The source of this import. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ModelImport - If the method is called asynchronously, returns the request - thread. + + :param import_file: The file to import (required) + :type import_file: bytearray + :param project: The project associated with this import + :type project: str + :param metadata: Additional metadata about imported run + :type metadata: object + :param source: The source of this import + :type source: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["import_file"] = import_file - return self.add_import_endpoint.call_with_http_info(**kwargs) - - def get_import(self, id, **kwargs): + + _param = self._add_import_serialize( + import_file=import_file, + project=project, + metadata=metadata, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "ModelImport", + "400": None, + "415": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_import_serialize( + self, + import_file, + project, + metadata, + source, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if import_file is not None: + _files["importFile"] = import_file + if project is not None: + _form_params.append(("project", project)) + if metadata is not None: + _form_params.append(("metadata", metadata)) + if source is not None: + _form_params.append(("source", source)) + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["multipart/form-data"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/import", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_import( + self, + id: Annotated[UUID, Field(description="The ID of the import")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelImport: + """Get the status of an import + + + :param id: The ID of the import (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_import_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ModelImport", + "202": "ModelImport", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_import_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the import")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelImport]: + """Get the status of an import + + + :param id: The ID of the import (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_import_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ModelImport", + "202": "ModelImport", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_import_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the import")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get the status of an import - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_import(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the import - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ModelImport - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the import (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_import_endpoint.call_with_http_info(**kwargs) + + _param = self._get_import_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ModelImport", + "202": "ModelImport", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_import_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/import/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/login_api.py b/ibutsu_client/api/login_api.py index 690a826..62c213d 100644 --- a/ibutsu_client/api/login_api.py +++ b/ibutsu_client/api/login_api.py @@ -3,19 +3,26 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.account_recovery import AccountRecovery -from ibutsu_client.model.account_registration import AccountRegistration -from ibutsu_client.model.account_reset import AccountReset -from ibutsu_client.model.credentials import Credentials -from ibutsu_client.model.login_config import LoginConfig -from ibutsu_client.model.login_support import LoginSupport -from ibutsu_client.model.login_token import LoginToken +from typing import Annotated, Any + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.account_recovery import AccountRecovery +from ibutsu_client.models.account_registration import AccountRegistration +from ibutsu_client.models.account_reset import AccountReset +from ibutsu_client.models.credentials import Credentials +from ibutsu_client.models.login_config import LoginConfig +from ibutsu_client.models.login_support import LoginSupport +from ibutsu_client.models.login_token import LoginToken +from ibutsu_client.rest import RESTResponseType class LoginApi: @@ -25,768 +32,1777 @@ class LoginApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.activate_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": [], - "endpoint_path": "/login/activate/{activation_code}", - "operation_id": "activate", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "activation_code", - ], - "required": [ - "activation_code", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "activation_code": (str,), - }, - "attribute_map": { - "activation_code": "activation_code", - }, - "location_map": { - "activation_code": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.auth_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": [], - "endpoint_path": "/login/auth/{provider}", - "operation_id": "auth", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "provider", - ], - "required": [ - "provider", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "provider": (str,), - }, - "attribute_map": { - "provider": "provider", - }, - "location_map": { - "provider": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.config_endpoint = _Endpoint( - settings={ - "response_type": (LoginConfig,), - "auth": [], - "endpoint_path": "/login/config/{provider}", - "operation_id": "config", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "provider", - ], - "required": [ - "provider", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "provider": (str,), - }, - "attribute_map": { - "provider": "provider", - }, - "location_map": { - "provider": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - ) - self.login_endpoint = _Endpoint( - settings={ - "response_type": (LoginToken,), - "auth": [], - "endpoint_path": "/login", - "operation_id": "login", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "credentials", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "credentials": (Credentials,), - }, - "attribute_map": {}, - "location_map": { - "credentials": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.recover_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": [], - "endpoint_path": "/login/recover", - "operation_id": "recover", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "account_recovery", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "account_recovery": (AccountRecovery,), - }, - "attribute_map": {}, - "location_map": { - "account_recovery": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": [], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.register_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": [], - "endpoint_path": "/login/register", - "operation_id": "register", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "account_registration", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "account_registration": (AccountRegistration,), - }, - "attribute_map": {}, - "location_map": { - "account_registration": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.reset_password_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": [], - "endpoint_path": "/login/reset-password", - "operation_id": "reset_password", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "account_reset", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "account_reset": (AccountReset,), - }, - "attribute_map": {}, - "location_map": { - "account_reset": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": [], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.support_endpoint = _Endpoint( - settings={ - "response_type": (LoginSupport,), - "auth": [], - "endpoint_path": "/login/support", - "operation_id": "support", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - ) - - def activate(self, activation_code, **kwargs): + + @validate_call + def activate( + self, + activation_code: Annotated[StrictStr, Field(description="The activation code")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """activate + + + :param activation_code: The activation code (required) + :type activation_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._activate_serialize( + activation_code=activation_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "302": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def activate_with_http_info( + self, + activation_code: Annotated[StrictStr, Field(description="The activation code")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: """activate - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.activate(activation_code, async_req=True) - >>> result = thread.get() - - Args: - activation_code (str): The activation code - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param activation_code: The activation code (required) + :type activation_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["activation_code"] = activation_code - return self.activate_endpoint.call_with_http_info(**kwargs) - - def auth(self, provider, **kwargs): + + _param = self._activate_serialize( + activation_code=activation_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "302": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def activate_without_preload_content( + self, + activation_code: Annotated[StrictStr, Field(description="The activation code")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """activate + + + :param activation_code: The activation code (required) + :type activation_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._activate_serialize( + activation_code=activation_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "302": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _activate_serialize( + self, + activation_code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if activation_code is not None: + _path_params["activation_code"] = activation_code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/login/activate/{activation_code}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def auth( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """auth + + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._auth_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def auth_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """auth + + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._auth_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def auth_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """auth - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.auth(provider, async_req=True) - >>> result = thread.get() - - Args: - provider (str): The login provider's configuration - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._auth_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _auth_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if provider is not None: + _path_params["provider"] = provider + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/login/auth/{provider}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def config( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginConfig: + """config + + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["provider"] = provider - return self.auth_endpoint.call_with_http_info(**kwargs) - - def config(self, provider, **kwargs): + + _param = self._config_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginConfig", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def config_with_http_info( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginConfig]: """config - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.config(provider, async_req=True) - >>> result = thread.get() - - Args: - provider (str): The login provider's configuration - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - LoginConfig - If the method is called asynchronously, returns the request - thread. + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["provider"] = provider - return self.config_endpoint.call_with_http_info(**kwargs) - - def login(self, **kwargs): + + _param = self._config_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginConfig", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def config_without_preload_content( + self, + provider: Annotated[StrictStr, Field(description="The login provider's configuration")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """config + + + :param provider: The login provider's configuration (required) + :type provider: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._config_serialize( + provider=provider, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginConfig", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _config_serialize( + self, + provider, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if provider is not None: + _path_params["provider"] = provider + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/login/config/{provider}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def login( + self, + credentials: Annotated[Credentials | None, Field(description="A login object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginToken: """login - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.login(async_req=True) - >>> result = thread.get() - - - Keyword Args: - credentials (Credentials): A login object. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - LoginToken - If the method is called asynchronously, returns the request - thread. + + :param credentials: A login object + :type credentials: Credentials + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._login_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginToken", + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def login_with_http_info( + self, + credentials: Annotated[Credentials | None, Field(description="A login object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginToken]: + """login + + + :param credentials: A login object + :type credentials: Credentials + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._login_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginToken", + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def login_without_preload_content( + self, + credentials: Annotated[Credentials | None, Field(description="A login object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """login + + + :param credentials: A login object + :type credentials: Credentials + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.login_endpoint.call_with_http_info(**kwargs) - - def recover(self, **kwargs): + + _param = self._login_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginToken", + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _login_serialize( + self, + credentials, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if credentials is not None: + _body_params = credentials + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/login", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def recover( + self, + account_recovery: Annotated[ + AccountRecovery | None, Field(description="A user recovering their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """recover + + + :param account_recovery: A user recovering their password + :type account_recovery: AccountRecovery + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._recover_serialize( + account_recovery=account_recovery, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def recover_with_http_info( + self, + account_recovery: Annotated[ + AccountRecovery | None, Field(description="A user recovering their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: """recover - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.recover(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_recovery (AccountRecovery): A user recovering their password. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param account_recovery: A user recovering their password + :type account_recovery: AccountRecovery + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.recover_endpoint.call_with_http_info(**kwargs) - - def register(self, **kwargs): + + _param = self._recover_serialize( + account_recovery=account_recovery, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def recover_without_preload_content( + self, + account_recovery: Annotated[ + AccountRecovery | None, Field(description="A user recovering their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """recover + + + :param account_recovery: A user recovering their password + :type account_recovery: AccountRecovery + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._recover_serialize( + account_recovery=account_recovery, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _recover_serialize( + self, + account_recovery, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_recovery is not None: + _body_params = account_recovery + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/login/recover", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def register( + self, + account_registration: Annotated[ + AccountRegistration | None, Field(description="A user registering their account") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: """register - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.register(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_registration (AccountRegistration): A user registering their account. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param account_registration: A user registering their account + :type account_registration: AccountRegistration + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._register_serialize( + account_registration=account_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def register_with_http_info( + self, + account_registration: Annotated[ + AccountRegistration | None, Field(description="A user registering their account") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """register + + + :param account_registration: A user registering their account + :type account_registration: AccountRegistration + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._register_serialize( + account_registration=account_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def register_without_preload_content( + self, + account_registration: Annotated[ + AccountRegistration | None, Field(description="A user registering their account") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """register + + + :param account_registration: A user registering their account + :type account_registration: AccountRegistration + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.register_endpoint.call_with_http_info(**kwargs) - - def reset_password(self, **kwargs): + + _param = self._register_serialize( + account_registration=account_registration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "401": "LoginError", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _register_serialize( + self, + account_registration, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_registration is not None: + _body_params = account_registration + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/login/register", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def reset_password( + self, + account_reset: Annotated[ + AccountReset | None, Field(description="A user resetting their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """reset_password + + + :param account_reset: A user resetting their password + :type account_reset: AccountReset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._reset_password_serialize( + account_reset=account_reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def reset_password_with_http_info( + self, + account_reset: Annotated[ + AccountReset | None, Field(description="A user resetting their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """reset_password + + + :param account_reset: A user resetting their password + :type account_reset: AccountReset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._reset_password_serialize( + account_reset=account_reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def reset_password_without_preload_content( + self, + account_reset: Annotated[ + AccountReset | None, Field(description="A user resetting their password") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """reset_password - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_password(async_req=True) - >>> result = thread.get() - - - Keyword Args: - account_reset (AccountReset): A user resetting their password. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param account_reset: A user resetting their password + :type account_reset: AccountReset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._reset_password_serialize( + account_reset=account_reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": None, + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _reset_password_serialize( + self, + account_reset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if account_reset is not None: + _body_params = account_reset + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/login/reset-password", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def support( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LoginSupport: + """support + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.reset_password_endpoint.call_with_http_info(**kwargs) - - def support(self, **kwargs): + + _param = self._support_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginSupport", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def support_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoginSupport]: + """support + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._support_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginSupport", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def support_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """support - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.support(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - LoginSupport - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.support_endpoint.call_with_http_info(**kwargs) + + _param = self._support_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "LoginSupport", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _support_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/login/support", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/project_api.py b/ibutsu_client/api/project_api.py index 69f3fb2..0cfc6d5 100644 --- a/ibutsu_client/api/project_api.py +++ b/ibutsu_client/api/project_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.project import Project -from ibutsu_client.model.project_list import ProjectList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.project import Project +from ibutsu_client.models.project_list import ProjectList +from ibutsu_client.rest import RESTResponseType class ProjectApi: @@ -20,429 +28,1234 @@ class ProjectApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/project", - "operation_id": "add_project", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "project", - ], - "required": [ - "project", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "project": (Project,), - }, - "attribute_map": {}, - "location_map": { - "project": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.get_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/project/{id}", - "operation_id": "get_project", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_project( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create a project + + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_project_list_endpoint = _Endpoint( - settings={ - "response_type": (ProjectList,), - "auth": ["jwt"], - "endpoint_path": "/project", - "operation_id": "get_project_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "owner_id", - "group_id", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "owner_id": (str,), - "group_id": (str,), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "owner_id": "ownerId", - "group_id": "groupId", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "owner_id": "query", - "group_id": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_project_with_http_info( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create a project + + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.update_project_endpoint = _Endpoint( - settings={ - "response_type": (Project,), - "auth": ["jwt"], - "endpoint_path": "/project/{id}", - "operation_id": "update_project", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "project", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "project": (Project,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "project": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - def add_project(self, project, **kwargs): + @validate_call + def add_project_without_preload_content( + self, + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Create a project - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_project(project, async_req=True) - >>> result = thread.get() - - Args: - project (Project): Project - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_project_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Project", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_project_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/project", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_filter_params( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> list[str]: + """Get a project's filterable parameters + + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["project"] = project - return self.add_project_endpoint.call_with_http_info(**kwargs) - - def get_project(self, id, **kwargs): + + _param = self._get_filter_params_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[str]", + "401": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_filter_params_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[list[str]]: + """Get a project's filterable parameters + + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_filter_params_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[str]", + "401": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_filter_params_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a project's filterable parameters + + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_filter_params_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[str]", + "401": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_filter_params_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project/filter-params/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: """Get a single project by ID - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_project(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of test project - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_project_endpoint.call_with_http_info(**kwargs) - - def get_project_list(self, **kwargs): + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_with_http_info( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Get a single project by ID + + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="ID of test project")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a single project by ID + + + :param id: ID of test project (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_project_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_project_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_project_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + owner_id: Annotated[ + StrictStr | None, Field(description="Filter projects by owner ID") + ] = None, + group_id: Annotated[ + StrictStr | None, Field(description="Filter projects by group ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ProjectList: """Get a list of projects - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_project_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - owner_id (str): Filter projects by owner ID. [optional] - group_id (str): Filter projects by group ID. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ProjectList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param owner_id: Filter projects by owner ID + :type owner_id: str + :param group_id: Filter projects by group ID + :type group_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_project_list_serialize( + filter=filter, + owner_id=owner_id, + group_id=group_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_project_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + owner_id: Annotated[ + StrictStr | None, Field(description="Filter projects by owner ID") + ] = None, + group_id: Annotated[ + StrictStr | None, Field(description="Filter projects by group ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ProjectList]: + """Get a list of projects + + + :param filter: Fields to filter by + :type filter: List[str] + :param owner_id: Filter projects by owner ID + :type owner_id: str + :param group_id: Filter projects by group ID + :type group_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_project_list_serialize( + filter=filter, + owner_id=owner_id, + group_id=group_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_project_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + owner_id: Annotated[ + StrictStr | None, Field(description="Filter projects by owner ID") + ] = None, + group_id: Annotated[ + StrictStr | None, Field(description="Filter projects by group ID") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of projects + + + :param filter: Fields to filter by + :type filter: List[str] + :param owner_id: Filter projects by owner ID + :type owner_id: str + :param group_id: Filter projects by group ID + :type group_id: str + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_project_list_serialize( + filter=filter, + owner_id=owner_id, + group_id=group_id, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ProjectList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_project_list_serialize( + self, + filter, + owner_id, + group_id, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if owner_id is not None: + _query_params.append(("ownerId", owner_id)) + + if group_id is not None: + _query_params.append(("groupId", group_id)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/project", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_project( + self, + id: Annotated[UUID, Field(description="ID of test project")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Update a project + + + :param id: ID of test project (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_project_list_endpoint.call_with_http_info(**kwargs) - - def update_project(self, id, **kwargs): + + _param = self._update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_project_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of test project")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: """Update a project - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_project(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of test project - - Keyword Args: - project (Project): Project. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Project - If the method is called asynchronously, returns the request - thread. + + :param id: ID of test project (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.update_project_endpoint.call_with_http_info(**kwargs) + + _param = self._update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_project_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of test project")], + project: Annotated[Project | None, Field(description="A project object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a project + + + :param id: ID of test project (required) + :type id: str + :param project: A project object + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_project_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Project", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_project_serialize( + self, + id, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if project is not None: + _body_params = project + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/project/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/report_api.py b/ibutsu_client/api/report_api.py index be8cd7f..6640439 100644 --- a/ibutsu_client/api/report_api.py +++ b/ibutsu_client/api/report_api.py @@ -3,19 +3,24 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.get_report_types200_response_inner import GetReportTypes200ResponseInner -from ibutsu_client.model.report import Report -from ibutsu_client.model.report_list import ReportList -from ibutsu_client.model.report_parameters import ReportParameters -from ibutsu_client.model_utils import ( - file_type, -) +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner +from ibutsu_client.models.report import Report +from ibutsu_client.models.report_list import ReportList +from ibutsu_client.models.report_parameters import ReportParameters +from ibutsu_client.rest import RESTResponseType class ReportApi: @@ -25,729 +30,1643 @@ class ReportApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_report_endpoint = _Endpoint( - settings={ - "response_type": (Report,), - "auth": ["jwt"], - "endpoint_path": "/report", - "operation_id": "add_report", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "report_parameters", - ], - "required": [ - "report_parameters", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "report_parameters": (ReportParameters,), - }, - "attribute_map": {}, - "location_map": { - "report_parameters": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.delete_report_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/report/{id}", - "operation_id": "delete_report", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, - ) - self.download_report_endpoint = _Endpoint( - settings={ - "response_type": (file_type,), - "auth": ["jwt"], - "endpoint_path": "/report/{id}/download/{filename}", - "operation_id": "download_report", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "filename", - ], - "required": [ - "id", - "filename", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "filename": (str,), - }, - "attribute_map": { - "id": "id", - "filename": "filename", - }, - "location_map": { - "id": "path", - "filename": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [ - "text/plain", - "application/csv", - "application/json", - "text/html", - "application/zip", - ], - "content_type": [], - }, - api_client=api_client, - ) - self.get_report_endpoint = _Endpoint( - settings={ - "response_type": (Report,), - "auth": ["jwt"], - "endpoint_path": "/report/{id}", - "operation_id": "get_report", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - ) - self.get_report_list_endpoint = _Endpoint( - settings={ - "response_type": (ReportList,), - "auth": ["jwt"], - "endpoint_path": "/report", - "operation_id": "get_report_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "page", - "page_size", - "project", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "page": (int,), - "page_size": (int,), - "project": (str,), - }, - "attribute_map": { - "page": "page", - "page_size": "pageSize", - "project": "project", - }, - "location_map": { - "page": "query", - "page_size": "query", - "project": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - ) - self.get_report_types_endpoint = _Endpoint( - settings={ - "response_type": ([GetReportTypes200ResponseInner],), - "auth": ["jwt"], - "endpoint_path": "/report/types", - "operation_id": "get_report_types", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, - ) - self.view_report_endpoint = _Endpoint( - settings={ - "response_type": (file_type,), - "auth": ["jwt"], - "endpoint_path": "/report/{id}/view/{filename}", - "operation_id": "view_report", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "filename", - ], - "required": [ - "id", - "filename", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "filename": (str,), - }, - "attribute_map": { - "id": "id", - "filename": "filename", - }, - "location_map": { - "id": "path", - "filename": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [ + + @validate_call + def add_report( + self, + report_parameters: Annotated[ + ReportParameters, Field(description="The parameters for the report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Report: + """Create a new report + + + :param report_parameters: The parameters for the report (required) + :type report_parameters: ReportParameters + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_report_serialize( + report_parameters=report_parameters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Report", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_report_with_http_info( + self, + report_parameters: Annotated[ + ReportParameters, Field(description="The parameters for the report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Report]: + """Create a new report + + + :param report_parameters: The parameters for the report (required) + :type report_parameters: ReportParameters + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_report_serialize( + report_parameters=report_parameters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Report", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def add_report_without_preload_content( + self, + report_parameters: Annotated[ + ReportParameters, Field(description="The parameters for the report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new report + + + :param report_parameters: The parameters for the report (required) + :type report_parameters: ReportParameters + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_report_serialize( + report_parameters=report_parameters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Report", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_report_serialize( + self, + report_parameters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if report_parameters is not None: + _body_params = report_parameters + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/report", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_report( + self, + id: Annotated[UUID, Field(description="ID of report to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a report + + + :param id: ID of report to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_report_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of report to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a report + + + :param id: ID of report to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_report_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of report to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a report + + + :param id: ID of report to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_report_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/report/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def download_report( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """Download a report + + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._download_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def download_report_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """Download a report + + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._download_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def download_report_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download a report + + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._download_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _download_report_serialize( + self, + id, + filename, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + if filename is not None: + _path_params["filename"] = filename + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + [ "text/plain", "application/csv", "application/json", "text/html", "application/zip", - ], - "content_type": [], - }, - api_client=api_client, + ] + ) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/report/{id}/download/{filename}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - def add_report(self, report_parameters, **kwargs): - """Create a new report + @validate_call + def get_report( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Report: + """Get a report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_report(report_parameters, async_req=True) - >>> result = thread.get() - - Args: - report_parameters (ReportParameters): The parameters for the report - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Report - If the method is called asynchronously, returns the request - thread. - """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["report_parameters"] = report_parameters - return self.add_report_endpoint.call_with_http_info(**kwargs) - - def delete_report(self, id, **kwargs): - """Delete a report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_report(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of report to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + :param id: The ID of the report (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.delete_report_endpoint.call_with_http_info(**kwargs) - - def download_report(self, id, filename, **kwargs): - """Download a report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.download_report(id, filename, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the report - filename (str): The file name of the downloadable report - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + _param = self._get_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Report", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_report_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Report]: + """Get a report + + + :param id: The ID of the report (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - kwargs["filename"] = filename - return self.download_report_endpoint.call_with_http_info(**kwargs) - - def get_report(self, id, **kwargs): + + _param = self._get_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Report", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_report_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_report(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the report - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Report - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the report (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_report_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Report", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_report_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/report/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_report_list( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + project: Annotated[ + StrictStr | None, Field(description="Filter reports by project ID") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ReportList: + """Get a list of reports + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param project: Filter reports by project ID + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_report_list_serialize( + page=page, + page_size=page_size, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ReportList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_report_list_with_http_info( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + project: Annotated[ + StrictStr | None, Field(description="Filter reports by project ID") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ReportList]: + """Get a list of reports + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param project: Filter reports by project ID + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_report_endpoint.call_with_http_info(**kwargs) - - def get_report_list(self, **kwargs): + + _param = self._get_report_list_serialize( + page=page, + page_size=page_size, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ReportList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_report_list_without_preload_content( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + project: Annotated[ + StrictStr | None, Field(description="Filter reports by project ID") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a list of reports - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_report_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - project (str): Filter reports by project ID. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ReportList - If the method is called asynchronously, returns the request - thread. + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param project: Filter reports by project ID + :type project: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_report_list_serialize( + page=page, + page_size=page_size, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ReportList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_report_list_serialize( + self, + page, + page_size, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + if project is not None: + _query_params.append(("project", project)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/report", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_report_types( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> list[GetReportTypes200ResponseInner]: + """Get a list of report types + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_report_types_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[GetReportTypes200ResponseInner]", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_report_types_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[list[GetReportTypes200ResponseInner]]: + """Get a list of report types + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_report_list_endpoint.call_with_http_info(**kwargs) - - def get_report_types(self, **kwargs): + + _param = self._get_report_types_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[GetReportTypes200ResponseInner]", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_report_types_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a list of report types - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_report_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - [GetReportTypes200ResponseInner] - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_report_types_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "List[GetReportTypes200ResponseInner]", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_report_types_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/report/types", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def view_report( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytearray: + """View a report + + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._view_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def view_report_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytearray]: + """View a report + + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_report_types_endpoint.call_with_http_info(**kwargs) - - def view_report(self, id, filename, **kwargs): + + _param = self._view_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def view_report_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the report")], + filename: Annotated[ + StrictStr, Field(description="The file name of the downloadable report") + ], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """View a report - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.view_report(id, filename, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the report - filename (str): The file name of the downloadable report - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - file_type - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the report (required) + :type id: str + :param filename: The file name of the downloadable report (required) + :type filename: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - kwargs["filename"] = filename - return self.view_report_endpoint.call_with_http_info(**kwargs) + + _param = self._view_report_serialize( + id=id, + filename=filename, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "bytearray", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _view_report_serialize( + self, + id, + filename, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + if filename is not None: + _path_params["filename"] = filename + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + [ + "text/plain", + "application/csv", + "application/json", + "text/html", + "application/zip", + ] + ) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/report/{id}/view/{filename}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/result_api.py b/ibutsu_client/api/result_api.py index b43a96a..1b85505 100644 --- a/ibutsu_client/api/result_api.py +++ b/ibutsu_client/api/result_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.result import Result -from ibutsu_client.model.result_list import ResultList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.result import Result +from ibutsu_client.models.result_list import ResultList +from ibutsu_client.rest import RESTResponseType class ResultApi: @@ -20,421 +28,996 @@ class ResultApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_result_endpoint = _Endpoint( - settings={ - "response_type": (Result,), - "auth": ["jwt"], - "endpoint_path": "/result", - "operation_id": "add_result", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "result", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "result": (Result,), - }, - "attribute_map": {}, - "location_map": { - "result": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self.get_result_endpoint = _Endpoint( - settings={ - "response_type": (Result,), - "auth": ["jwt"], - "endpoint_path": "/result/{id}", - "operation_id": "get_result", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_result( + self, + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Result: + """Create a test result + + + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_result_serialize( + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_result_list_endpoint = _Endpoint( - settings={ - "response_type": (ResultList,), - "auth": ["jwt"], - "endpoint_path": "/result", - "operation_id": "get_result_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "estimate", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "estimate": (bool,), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "estimate": "estimate", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "estimate": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Result", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_result_with_http_info( + self, + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Result]: + """Create a test result + + + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_result_serialize( + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.update_result_endpoint = _Endpoint( - settings={ - "response_type": (Result,), - "auth": ["jwt"], - "endpoint_path": "/result/{id}", - "operation_id": "update_result", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "result", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "result": (Result,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "result": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Result", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - def add_result(self, **kwargs): + @validate_call + def add_result_without_preload_content( + self, + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Create a test result - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_result(async_req=True) - >>> result = thread.get() - - - Keyword Args: - result (Result): Result item. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Result - If the method is called asynchronously, returns the request - thread. + + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_result_serialize( + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Result", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_result_serialize( + self, + result, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if result is not None: + _body_params = result + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/result", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_result( + self, + id: Annotated[UUID, Field(description="ID of result to return (uuid required)")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Result: + """Get a single result + + + :param id: ID of result to return (uuid required) (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_result_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_result_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of result to return (uuid required)")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Result]: + """Get a single result + + + :param id: ID of result to return (uuid required) (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.add_result_endpoint.call_with_http_info(**kwargs) - - def get_result(self, id, **kwargs): + + _param = self._get_result_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_result_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of result to return (uuid required)")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a single result - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_result(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of result to return (uuid required) - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Result - If the method is called asynchronously, returns the request - thread. + + :param id: ID of result to return (uuid required) (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_result_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_result_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/result/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_result_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ResultList: + """Get the list of results. + + The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /result?filter=metadata.run=63fe5 /result?filter=test_id~neg /result?filter=result!passed + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_result_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ResultList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_result_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ResultList]: + """Get the list of results. + + The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /result?filter=metadata.run=63fe5 /result?filter=test_id~neg /result?filter=result!passed + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_result_endpoint.call_with_http_info(**kwargs) - - def get_result_list(self, **kwargs): + + _param = self._get_result_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ResultList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_result_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get the list of results. The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /result?filter=metadata.run=63fe5 /result?filter=test_id~neg /result?filter=result!passed - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_result_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - estimate (bool): Return an estimated count. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ResultList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_result_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "ResultList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_result_list_serialize( + self, + filter, + estimate, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if estimate is not None: + _query_params.append(("estimate", estimate)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/result", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_result( + self, + id: Annotated[UUID, Field(description="ID of result to update")], + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Result: + """Updates a single result + + + :param id: ID of result to update (required) + :type id: str + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_result_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_result_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of result to update")], + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Result]: + """Updates a single result + + + :param id: ID of result to update (required) + :type id: str + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_result_list_endpoint.call_with_http_info(**kwargs) - - def update_result(self, id, **kwargs): + + _param = self._update_result_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_result_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of result to update")], + result: Annotated[Result | None, Field(description="Result item")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Updates a single result - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_result(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of result to update - - Keyword Args: - result (Result): Result item. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Result - If the method is called asynchronously, returns the request - thread. + + :param id: ID of result to update (required) + :type id: str + :param result: Result item + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.update_result_endpoint.call_with_http_info(**kwargs) + + _param = self._update_result_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Result", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_result_serialize( + self, + id, + result, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if result is not None: + _body_params = result + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/result/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/run_api.py b/ibutsu_client/api/run_api.py index 04e1a11..5349b0f 100644 --- a/ibutsu_client/api/run_api.py +++ b/ibutsu_client/api/run_api.py @@ -3,15 +3,23 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.run import Run -from ibutsu_client.model.run_list import RunList -from ibutsu_client.model.update_run import UpdateRun +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.run import Run +from ibutsu_client.models.run_list import RunList +from ibutsu_client.models.update_run import UpdateRun +from ibutsu_client.rest import RESTResponseType class RunApi: @@ -21,533 +29,1277 @@ class RunApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_run_endpoint = _Endpoint( - settings={ - "response_type": (Run,), - "auth": ["jwt"], - "endpoint_path": "/run", - "operation_id": "add_run", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "run", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "run": (Run,), - }, - "attribute_map": {}, - "location_map": { - "run": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def add_run( + self, + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Run: + """Create a run + + + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_run_serialize( + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "201": "Run", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_run_with_http_info( + self, + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Run]: + """Create a run + + + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_run_serialize( + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.bulk_update_endpoint = _Endpoint( - settings={ - "response_type": (RunList,), - "auth": ["jwt"], - "endpoint_path": "/runs/bulk-update", - "operation_id": "bulk_update", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "update_run", - "filter", - "page_size", - ], - "required": [ - "update_run", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "update_run": (UpdateRun,), - "filter": ([str],), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "page_size": "pageSize", - }, - "location_map": { - "update_run": "body", - "filter": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Run", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.get_run_endpoint = _Endpoint( - settings={ - "response_type": (Run,), - "auth": ["jwt"], - "endpoint_path": "/run/{id}", - "operation_id": "get_run", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_run_without_preload_content( + self, + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a run + + + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_run_serialize( + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_run_list_endpoint = _Endpoint( - settings={ - "response_type": (RunList,), - "auth": ["jwt"], - "endpoint_path": "/run", - "operation_id": "get_run_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "estimate", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "estimate": (bool,), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "estimate": "estimate", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "estimate": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Run", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_run_serialize( + self, + run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if run is not None: + _body_params = run + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/run", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - self.update_run_endpoint = _Endpoint( - settings={ - "response_type": (Run,), - "auth": ["jwt"], - "endpoint_path": "/run/{id}", - "operation_id": "update_run", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "run", - ], - "required": [ - "id", - "run", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "run": (Run,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "run": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def bulk_update( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + update_run: Annotated[UpdateRun | None, Field(description="Run metadata updates")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunList: + """Update multiple runs with common metadata + + + :param filter: Fields to filter by + :type filter: List[str] + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param update_run: Run metadata updates + :type update_run: UpdateRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._bulk_update_serialize( + filter=filter, + page_size=page_size, + update_run=update_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - def add_run(self, **kwargs): - """Create a run + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "400": None, + "401": None, + "404": None, + "405": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_run(async_req=True) - >>> result = thread.get() - - - Keyword Args: - run (Run): Run item. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Run - If the method is called asynchronously, returns the request - thread. + @validate_call + def bulk_update_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + update_run: Annotated[UpdateRun | None, Field(description="Run metadata updates")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunList]: + """Update multiple runs with common metadata + + + :param filter: Fields to filter by + :type filter: List[str] + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param update_run: Run metadata updates + :type update_run: UpdateRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.add_run_endpoint.call_with_http_info(**kwargs) - - def bulk_update(self, update_run, **kwargs): + + _param = self._bulk_update_serialize( + filter=filter, + page_size=page_size, + update_run=update_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "400": None, + "401": None, + "404": None, + "405": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def bulk_update_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + update_run: Annotated[UpdateRun | None, Field(description="Run metadata updates")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Update multiple runs with common metadata - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bulk_update(update_run, async_req=True) - >>> result = thread.get() - - Args: - update_run (UpdateRun): The metadata to add to the test runs - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - RunList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param update_run: Run metadata updates + :type update_run: UpdateRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._bulk_update_serialize( + filter=filter, + page_size=page_size, + update_run=update_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "400": None, + "401": None, + "404": None, + "405": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _bulk_update_serialize( + self, + filter, + page_size, + update_run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + if update_run is not None: + _body_params = update_run + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/runs/bulk-update", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_run( + self, + id: Annotated[UUID, Field(description="ID of test run")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Run: + """Get a single run by ID (uuid required) + + + :param id: ID of test run (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_run_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_run_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of test run")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Run]: + """Get a single run by ID (uuid required) + + + :param id: ID of test run (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["update_run"] = update_run - return self.bulk_update_endpoint.call_with_http_info(**kwargs) - - def get_run(self, id, **kwargs): + + _param = self._get_run_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_run_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of test run")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a single run by ID (uuid required) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_run(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of test run - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Run - If the method is called asynchronously, returns the request - thread. + + :param id: ID of test run (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_run_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_run_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/run/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_run_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunList: + """Get a list of the test runs + + The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /run?filter=metadata.jenkins.job_name=jenkins_job /run?filter=summary.failures>0 + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_run_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_run_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunList]: + """Get a list of the test runs + + The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /run?filter=metadata.jenkins.job_name=jenkins_job /run?filter=summary.failures>0 + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_run_endpoint.call_with_http_info(**kwargs) - - def get_run_list(self, **kwargs): + + _param = self._get_run_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_run_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + estimate: Annotated[ + StrictBool | None, Field(description="Return an estimated count") + ] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a list of the test runs The `filter` parameter takes a list of filters to apply in the form of: {name}{operator}{value} where: - `name` is any valid column in the database - `operator` is one of `=`, `!`, `>`, `<`, `)`, `(`, `~`, `*` - `value` is what you want to filter by Operators are simple correspondents to MongoDB's query selectors: - `=` becomes `$eq` - `!` becomes `$ne` - `>` becomes `$gt` - `<` becomes `$lt` - `)` becomes `$gte` - `(` becomes `$lte` - `~` becomes `$regex` - `*` becomes `$in` - `@` becomes `$exists` Notes: - For the `$exists` operator, \"true\", \"t\", \"yes\", \"y\" and `1` will all be considered true, all other values are considered false. Example queries: /run?filter=metadata.jenkins.job_name=jenkins_job /run?filter=summary.failures>0 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_run_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - estimate (bool): Return an estimated count. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - RunList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param estimate: Return an estimated count + :type estimate: bool + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_run_list_serialize( + filter=filter, + estimate=estimate, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "RunList", + "201": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_run_list_serialize( + self, + filter, + estimate, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if estimate is not None: + _query_params.append(("estimate", estimate)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/run", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_run( + self, + id: Annotated[UUID, Field(description="ID of the test run")], + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Run: + """Update a single run + + + :param id: ID of the test run (required) + :type id: str + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_run_serialize( + id=id, + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_run_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of the test run")], + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Run]: + """Update a single run + + + :param id: ID of the test run (required) + :type id: str + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_run_list_endpoint.call_with_http_info(**kwargs) - - def update_run(self, id, run, **kwargs): + + _param = self._update_run_serialize( + id=id, + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_run_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of the test run")], + run: Annotated[Run | None, Field(description="A run object")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Update a single run - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_run(id, run, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of the test run - run (Run): The updated test run - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Run - If the method is called asynchronously, returns the request - thread. + + :param id: ID of the test run (required) + :type id: str + :param run: A run object + :type run: Run + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - kwargs["run"] = run - return self.update_run_endpoint.call_with_http_info(**kwargs) + + _param = self._update_run_serialize( + id=id, + run=run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Run", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_run_serialize( + self, + id, + run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if run is not None: + _body_params = run + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/run/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/task_api.py b/ibutsu_client/api/task_api.py index fbca75b..4bd0f56 100644 --- a/ibutsu_client/api/task_api.py +++ b/ibutsu_client/api/task_api.py @@ -3,17 +3,20 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model_utils import ( - date, - datetime, - none_type, -) +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.rest import RESTResponseType class TaskApi: @@ -23,111 +26,229 @@ class TaskApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_task_endpoint = _Endpoint( - settings={ - "response_type": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "auth": ["jwt"], - "endpoint_path": "/task/{id}", - "operation_id": "get_task", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def get_task( + self, + id: Annotated[UUID, Field(description="The ID of the task")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Get the status or result of a task + + + :param id: The ID of the task (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_task_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - def get_task(self, id, **kwargs): + _response_types_map: dict[str, str | None] = { + "200": "object", + "206": "object", + "203": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_task_with_http_info( + self, + id: Annotated[UUID, Field(description="The ID of the task")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: """Get the status or result of a task - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_task(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The ID of the task - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. + + :param id: The ID of the task (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_task_endpoint.call_with_http_info(**kwargs) + + _param = self._get_task_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "object", + "206": "object", + "203": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_task_without_preload_content( + self, + id: Annotated[UUID, Field(description="The ID of the task")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the status or result of a task + + + :param id: The ID of the task (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_task_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "object", + "206": "object", + "203": "object", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_task_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/task/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/user_api.py b/ibutsu_client/api/user_api.py index 0dce9d3..9151b6a 100644 --- a/ibutsu_client/api/user_api.py +++ b/ibutsu_client/api/user_api.py @@ -3,16 +3,23 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.create_token import CreateToken -from ibutsu_client.model.token import Token -from ibutsu_client.model.token_list import TokenList -from ibutsu_client.model.user import User +from typing import Annotated, Any + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.create_token import CreateToken +from ibutsu_client.models.token import Token +from ibutsu_client.models.token_list import TokenList +from ibutsu_client.models.user import User +from ibutsu_client.rest import RESTResponseType class UserApi: @@ -22,573 +29,1335 @@ class UserApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_token_endpoint = _Endpoint( - settings={ - "response_type": (Token,), - "auth": ["jwt"], - "endpoint_path": "/user/token", - "operation_id": "add_token", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "create_token", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "create_token": (CreateToken,), - }, - "attribute_map": {}, - "location_map": { - "create_token": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def add_token( + self, + create_token: Annotated[ + CreateToken | None, Field(description="Create a token for a user") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Token: + """Create a token for the current user + + + :param create_token: Create a token for a user + :type create_token: CreateToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_token_serialize( + create_token=create_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.delete_token_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/user/token/{id}", - "operation_id": "delete_token", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_token_with_http_info( + self, + create_token: Annotated[ + CreateToken | None, Field(description="Create a token for a user") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Token]: + """Create a token for the current user + + + :param create_token: Create a token for a user + :type create_token: CreateToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_token_serialize( + create_token=create_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_current_user_endpoint = _Endpoint( - settings={ - "response_type": (User,), - "auth": ["jwt"], - "endpoint_path": "/user", - "operation_id": "get_current_user", - "http_method": "GET", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.get_token_endpoint = _Endpoint( - settings={ - "response_type": (Token,), - "auth": ["jwt"], - "endpoint_path": "/user/token/{id}", - "operation_id": "get_token", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_token_without_preload_content( + self, + create_token: Annotated[ + CreateToken | None, Field(description="Create a token for a user") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a token for the current user + + + :param create_token: Create a token for a user + :type create_token: CreateToken + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_token_serialize( + create_token=create_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_token_list_endpoint = _Endpoint( - settings={ - "response_type": (TokenList,), - "auth": ["jwt"], - "endpoint_path": "/user/token", - "operation_id": "get_token_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "page": "query", - "page_size": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_token_serialize( + self, + create_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_token is not None: + _body_params = create_token + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/user/token", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - self.update_current_user_endpoint = _Endpoint( - settings={ - "response_type": (User,), - "auth": ["jwt"], - "endpoint_path": "/user", - "operation_id": "update_current_user", - "http_method": "PUT", - "servers": None, - }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def delete_token( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the token + + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - def add_token(self, **kwargs): - """Create a token for the current user + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_token(async_req=True) - >>> result = thread.get() - - - Keyword Args: - create_token (CreateToken): Create a token for a user. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Token - If the method is called asynchronously, returns the request - thread. + @validate_call + def delete_token_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the token + + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.add_token_endpoint.call_with_http_info(**kwargs) - - def delete_token(self, id, **kwargs): + + _param = self._delete_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_token_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Delete the token - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_token(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The id of a token - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.delete_token_endpoint.call_with_http_info(**kwargs) - - def get_current_user(self, **kwargs): + + _param = self._delete_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_token_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/user/token/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_current_user( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: """Return the user details for the current user - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_current_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_current_user_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Return the user details for the current user + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_current_user_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Return the user details for the current user + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_current_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/user", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_token( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Token: + """Retrieve a single token for the current user + + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_current_user_endpoint.call_with_http_info(**kwargs) - - def get_token(self, id, **kwargs): + + _param = self._get_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_token_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Token]: """Retrieve a single token for the current user - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_token(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The id of a token - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Token - If the method is called asynchronously, returns the request - thread. + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_token_endpoint.call_with_http_info(**kwargs) - - def get_token_list(self, **kwargs): + + _param = self._get_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_token_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The id of a token")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve a single token for the current user + + + :param id: The id of a token (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_token_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "Token", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_token_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/user/token/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_token_list( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TokenList: + """Return the tokens for the user + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_token_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "TokenList", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_token_list_with_http_info( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TokenList]: + """Return the tokens for the user + + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_token_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "TokenList", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_token_list_without_preload_content( + self, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Return the tokens for the user - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_token_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - TokenList - If the method is called asynchronously, returns the request - thread. + + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_token_list_endpoint.call_with_http_info(**kwargs) - - def update_current_user(self, **kwargs): + + _param = self._get_token_list_serialize( + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "TokenList", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_token_list_serialize( + self, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/user/token", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_current_user( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: """Return the user details for the current user - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_current_user(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - User - If the method is called asynchronously, returns the request - thread. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.update_current_user_endpoint.call_with_http_info(**kwargs) + + _param = self._update_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_current_user_with_http_info( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Return the user details for the current user + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_current_user_without_preload_content( + self, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Return the user details for the current user + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "User", + "401": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_current_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/user", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/widget_api.py b/ibutsu_client/api/widget_api.py index e8fa3c0..4cddd66 100644 --- a/ibutsu_client/api/widget_api.py +++ b/ibutsu_client/api/widget_api.py @@ -3,18 +3,21 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.widget_type_list import WidgetTypeList -from ibutsu_client.model_utils import ( - date, - datetime, - none_type, -) +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.widget_type_list import WidgetTypeList +from ibutsu_client.rest import RESTResponseType class WidgetApi: @@ -24,217 +27,468 @@ class WidgetApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_widget_endpoint = _Endpoint( - settings={ - "response_type": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "auth": ["jwt"], - "endpoint_path": "/widget/{id}", - "operation_id": "get_widget", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - "params", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "params": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - }, - "attribute_map": { - "id": "id", - "params": "params", - }, - "location_map": { - "id": "path", - "params": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def get_widget( + self, + id: Annotated[UUID, Field(description="The widget identifier")], + params: Annotated[ + dict[str, Any] | None, Field(description="The parameters for the widget") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> object: + """Generate data for a dashboard widget + + + :param id: The widget identifier (required) + :type id: str + :param params: The parameters for the widget + :type params: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_serialize( + id=id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "object", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_widget_with_http_info( + self, + id: Annotated[UUID, Field(description="The widget identifier")], + params: Annotated[ + dict[str, Any] | None, Field(description="The parameters for the widget") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[object]: + """Generate data for a dashboard widget + + + :param id: The widget identifier (required) + :type id: str + :param params: The parameters for the widget + :type params: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_serialize( + id=id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_widget_types_endpoint = _Endpoint( - settings={ - "response_type": (WidgetTypeList,), - "auth": ["jwt"], - "endpoint_path": "/widget/types", - "operation_id": "get_widget_types", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "type", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "type": (str,), - }, - "attribute_map": { - "type": "type", - }, - "location_map": { - "type": "query", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "200": "object", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - def get_widget(self, id, **kwargs): + @validate_call + def get_widget_without_preload_content( + self, + id: Annotated[UUID, Field(description="The widget identifier")], + params: Annotated[ + dict[str, Any] | None, Field(description="The parameters for the widget") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Generate data for a dashboard widget - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_widget(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): The widget identifier - - Keyword Args: - params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The parameters for the widget. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. + + :param id: The widget identifier (required) + :type id: str + :param params: The parameters for the widget + :type params: object + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_serialize( + id=id, + params=params, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "object", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_widget_serialize( + self, + id, + params, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + if params is not None: + _query_params.append(("params", params)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/widget/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_widget_types( + self, + type: Annotated[StrictStr | None, Field(description="Filter by type of widget")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WidgetTypeList: + """Get a list of widget types + + A list of widget types + + :param type: Filter by type of widget + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_types_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetTypeList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_widget_types_with_http_info( + self, + type: Annotated[StrictStr | None, Field(description="Filter by type of widget")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WidgetTypeList]: + """Get a list of widget types + + A list of widget types + + :param type: Filter by type of widget + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_widget_endpoint.call_with_http_info(**kwargs) - - def get_widget_types(self, **kwargs): + + _param = self._get_widget_types_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetTypeList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_widget_types_without_preload_content( + self, + type: Annotated[StrictStr | None, Field(description="Filter by type of widget")] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Get a list of widget types A list of widget types - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_widget_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - type (str): Filter by type of widget. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - WidgetTypeList - If the method is called asynchronously, returns the request - thread. + + :param type: Filter by type of widget + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_widget_types_endpoint.call_with_http_info(**kwargs) + + _param = self._get_widget_types_serialize( + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetTypeList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_widget_types_serialize( + self, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if type is not None: + _query_params.append(("type", type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/widget/types", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api/widget_config_api.py b/ibutsu_client/api/widget_config_api.py index 19c2fbb..4fa43da 100644 --- a/ibutsu_client/api/widget_config_api.py +++ b/ibutsu_client/api/widget_config_api.py @@ -3,14 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -from ibutsu_client.api_client import ApiClient -from ibutsu_client.api_client import Endpoint as _Endpoint -from ibutsu_client.model.widget_config import WidgetConfig -from ibutsu_client.model.widget_config_list import WidgetConfigList +from typing import Annotated, Any +from uuid import UUID + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from ibutsu_client.api_client import ApiClient, RequestSerialized +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.models.widget_config import WidgetConfig +from ibutsu_client.models.widget_config_list import WidgetConfigList +from ibutsu_client.rest import RESTResponseType class WidgetConfigApi: @@ -20,518 +28,1198 @@ class WidgetConfigApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_widget_config_endpoint = _Endpoint( - settings={ - "response_type": (WidgetConfig,), - "auth": ["jwt"], - "endpoint_path": "/widget-config", - "operation_id": "add_widget_config", - "http_method": "POST", - "servers": None, - }, - params_map={ - "all": [ - "widget_config", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "widget_config": (WidgetConfig,), - }, - "attribute_map": {}, - "location_map": { - "widget_config": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + @validate_call + def add_widget_config( + self, + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WidgetConfig: + """Create a widget configuration + + + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_widget_config_serialize( + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.delete_widget_config_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["jwt"], - "endpoint_path": "/widget-config/{id}", - "operation_id": "delete_widget_config", - "http_method": "DELETE", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": [], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "WidgetConfig", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def add_widget_config_with_http_info( + self, + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WidgetConfig]: + """Create a widget configuration + + + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_widget_config_serialize( + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.get_widget_config_endpoint = _Endpoint( - settings={ - "response_type": (WidgetConfig,), - "auth": ["jwt"], - "endpoint_path": "/widget-config/{id}", - "operation_id": "get_widget_config", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "id", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - }, - "collection_format_map": {}, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "WidgetConfig", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.get_widget_config_list_endpoint = _Endpoint( - settings={ - "response_type": (WidgetConfigList,), - "auth": ["jwt"], - "endpoint_path": "/widget-config", - "operation_id": "get_widget_config_list", - "http_method": "GET", - "servers": None, - }, - params_map={ - "all": [ - "filter", - "page", - "page_size", - ], - "required": [], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "filter": ([str],), - "page": (int,), - "page_size": (int,), - }, - "attribute_map": { - "filter": "filter", - "page": "page", - "page_size": "pageSize", - }, - "location_map": { - "filter": "query", - "page": "query", - "page_size": "query", - }, - "collection_format_map": { - "filter": "multi", - }, - }, - headers_map={ - "accept": ["application/json"], - "content_type": [], - }, - api_client=api_client, + + @validate_call + def add_widget_config_without_preload_content( + self, + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a widget configuration + + + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._add_widget_config_serialize( + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - self.update_widget_config_endpoint = _Endpoint( - settings={ - "response_type": (WidgetConfig,), - "auth": ["jwt"], - "endpoint_path": "/widget-config/{id}", - "operation_id": "update_widget_config", - "http_method": "PUT", - "servers": None, - }, - params_map={ - "all": [ - "id", - "widget_config", - ], - "required": [ - "id", - ], - "nullable": [], - "enum": [], - "validation": [], - }, - root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "id": (str,), - "widget_config": (WidgetConfig,), - }, - "attribute_map": { - "id": "id", - }, - "location_map": { - "id": "path", - "widget_config": "body", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, + + _response_types_map: dict[str, str | None] = { + "201": "WidgetConfig", + "400": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _add_widget_config_serialize( + self, + widget_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if widget_config is not None: + _body_params = widget_config + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/widget-config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - def add_widget_config(self, **kwargs): - """Create a widget configuration + @validate_call + def delete_widget_config( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a widget configuration + + + :param id: ID of widget configuration to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._delete_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_widget_config(async_req=True) - >>> result = thread.get() - - - Keyword Args: - widget_config (WidgetConfig): Widget configuration. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - WidgetConfig - If the method is called asynchronously, returns the request - thread. + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_widget_config_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a widget configuration + + + :param id: ID of widget configuration to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.add_widget_config_endpoint.call_with_http_info(**kwargs) - - def delete_widget_config(self, id, **kwargs): + + _param = self._delete_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_widget_config_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to delete")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Delete a widget configuration - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_widget_config(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of widget configuration to delete - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. + + :param id: ID of widget configuration to delete (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.delete_widget_config_endpoint.call_with_http_info(**kwargs) - - def get_widget_config(self, id, **kwargs): + + _param = self._delete_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_widget_config_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/widget-config/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_widget_config( + self, + id: Annotated[UUID, Field(description="ID of widget config to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WidgetConfig: + """Get a single widget configuration + + + :param id: ID of widget config to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_widget_config_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of widget config to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WidgetConfig]: """Get a single widget configuration - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_widget_config(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of widget config to return - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - WidgetConfig - If the method is called asynchronously, returns the request - thread. + + :param id: ID of widget config to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_widget_config_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of widget config to return")], + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a single widget configuration + + + :param id: ID of widget config to return (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.get_widget_config_endpoint.call_with_http_info(**kwargs) - - def get_widget_config_list(self, **kwargs): + + _param = self._get_widget_config_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_widget_config_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/widget-config/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_widget_config_list( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WidgetConfigList: """Get the list of widget configurations A list of widget configurations - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_widget_config_list(async_req=True) - >>> result = thread.get() - - - Keyword Args: - filter ([str]): Fields to filter by. [optional] - page (int): Set the page of items to return, defaults to 1. [optional] - page_size (int): Set the number of items per page, defaults to 25. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - WidgetConfigList - If the method is called asynchronously, returns the request - thread. + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - return self.get_widget_config_list_endpoint.call_with_http_info(**kwargs) - - def update_widget_config(self, id, **kwargs): + + _param = self._get_widget_config_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfigList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_widget_config_list_with_http_info( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WidgetConfigList]: + """Get the list of widget configurations + + A list of widget configurations + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_config_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfigList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_widget_config_list_without_preload_content( + self, + filter: Annotated[list[StrictStr] | None, Field(description="Fields to filter by")] = None, + page: Annotated[ + StrictInt | None, Field(description="Set the page of items to return, defaults to 1") + ] = None, + page_size: Annotated[ + Annotated[int, Field(strict=True, ge=1)] | None, + Field(description="Set the number of items per page, defaults to 25"), + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the list of widget configurations + + A list of widget configurations + + :param filter: Fields to filter by + :type filter: List[str] + :param page: Set the page of items to return, defaults to 1 + :type page: int + :param page_size: Set the number of items per page, defaults to 25 + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._get_widget_config_list_serialize( + filter=filter, + page=page, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfigList", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_widget_config_list_serialize( + self, + filter, + page, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = { + "filter": "multi", + } + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + # process the query parameters + if filter is not None: + _query_params.append(("filter", filter)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("pageSize", page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/widget-config", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_widget_config( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to update")], + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WidgetConfig: + """Updates a single widget configuration + + + :param id: ID of widget configuration to update (required) + :type id: str + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_widget_config_serialize( + id=id, + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_widget_config_with_http_info( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to update")], + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WidgetConfig]: + """Updates a single widget configuration + + + :param id: ID of widget configuration to update (required) + :type id: str + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + + _param = self._update_widget_config_serialize( + id=id, + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_widget_config_without_preload_content( + self, + id: Annotated[UUID, Field(description="ID of widget configuration to update")], + widget_config: Annotated[ + WidgetConfig | None, Field(description="Widget configuration") + ] = None, + _request_timeout: None + | Annotated[StrictFloat, Field(gt=0)] + | tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]] = None, + _request_auth: dict[StrictStr, Any] | None = None, + _content_type: StrictStr | None = None, + _headers: dict[StrictStr, Any] | None = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: """Updates a single widget configuration - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_widget_config(id, async_req=True) - >>> result = thread.get() - - Args: - id (str): ID of widget configuration to update - - Keyword Args: - widget_config (WidgetConfig): Widget configuration. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - WidgetConfig - If the method is called asynchronously, returns the request - thread. + + :param id: ID of widget configuration to update (required) + :type id: str + :param widget_config: Widget configuration + :type widget_config: WidgetConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ - kwargs["async_req"] = kwargs.get("async_req", False) - kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) - kwargs["_preload_content"] = kwargs.get("_preload_content", True) - kwargs["_request_timeout"] = kwargs.get("_request_timeout") - kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) - kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) - kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) - kwargs["_content_type"] = kwargs.get("_content_type") - kwargs["_host_index"] = kwargs.get("_host_index") - kwargs["_request_auths"] = kwargs.get("_request_auths") - kwargs["id"] = id - return self.update_widget_config_endpoint.call_with_http_info(**kwargs) + + _param = self._update_widget_config_serialize( + id=id, + widget_config=widget_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, str | None] = { + "200": "WidgetConfig", + "400": None, + "404": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_widget_config_serialize( + self, + id, + widget_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, str | None] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, str | bytes | list[str] | list[bytes] | list[tuple[str, bytes]]] = {} + _body_params: bytes | None = None + + # process the path parameters + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if widget_config is not None: + _body_params = widget_config + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["jwt"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/widget-config/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/ibutsu_client/api_client.py b/ibutsu_client/api_client.py index 53ff758..92e3b65 100644 --- a/ibutsu_client/api_client.py +++ b/ibutsu_client/api_client.py @@ -3,40 +3,38 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ -import atexit -import io +import datetime +import decimal import json import mimetypes import os import re -import typing -from multiprocessing.pool import ThreadPool +import tempfile +import uuid +from enum import Enum from urllib.parse import quote -from urllib3.fields import RequestField +from dateutil.parser import parse +from pydantic import SecretStr +import ibutsu_client.models from ibutsu_client import rest +from ibutsu_client.api_response import ApiResponse +from ibutsu_client.api_response import T as ApiResponseT from ibutsu_client.configuration import Configuration -from ibutsu_client.exceptions import ApiException, ApiTypeError, ApiValueError -from ibutsu_client.model_utils import ( - ModelComposed, - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types, +from ibutsu_client.exceptions import ( + ApiException, + ApiValueError, ) +RequestSerialized = tuple[str, str, dict[str, str], str | None, list[str]] + class ApiClient: """Generic API client for OpenAPI client library builds. @@ -46,29 +44,35 @@ class ApiClient: the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "decimal": decimal.Decimal, + "object": object, + } _pool = None def __init__( - self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1 - ): + self, configuration=None, header_name=None, header_value=None, cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -76,31 +80,14 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/2.3.0/python" + self.user_agent = "OpenAPI-Generator/3.0.0/python" + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, "unregister"): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -114,27 +101,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None, - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None, + ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + config = self.configuration # header parameters @@ -156,23 +185,13 @@ def __call_api( "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) post_params = self.parameters_to_tuples(post_params, collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params["Content-Type"].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, (dict)) - - # body - if body: - body = self.sanitize_for_serialization(body) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( @@ -182,365 +201,242 @@ def __call_api( resource_path, method, body, - request_auths=_request_auths, + request_auth=_request_auth, ) + # body + if body: + body = self.sanitize_for_serialization(body) + # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, collection_formats) + url += "?" + url_query + + return method, url, header_params, body, post_params + + def call_api( + self, method, url, header_params=None, body=None, post_params=None, _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, + post_params=post_params, _request_timeout=_request_timeout, ) + except ApiException as e: - e.body = e.body.decode("utf-8") raise e - self.last_response = response_data + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: dict[str, ApiResponseT] | None = None, + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - return return_data - return return_data + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader("content-type") if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize(response_data, response_type, _check_type) - else: - return_data = None + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - if _return_http_data_only: - return return_data - else: - return (return_data, response_data.status, response_data.getheaders()) + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = dict - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance( - v, collection_types - ): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) - for key, val in model_to_dict(obj, serialize=True).items() - } - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError(f"Unable to prepare type {obj.__class__.__name__} for serialization") - - def deserialize(self, response, response_type, _check_type): + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, "to_dict") and callable(obj.to_dict): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} + + def deserialize(self, response_text: str, response_type: str, content_type: str | None): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file( - response.data, self.configuration, content_disposition=content_disposition - ) # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ["received_data"], - True, - _check_type, - configuration=self.configuration, - ) - return deserialized_data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match( + r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE + ): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException(status=0, reason=f"Unsupported content type: {content_type}") - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None, - ): - """Makes the HTTP request (synchronous) and returns deserialized data. + return self.__deserialize(data, response_type) - To make an async_req request, set the async_req parameter. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _check_type, - _request_auths=_request_auths, - ) + :param data: dict, list or str. + :param klass: class literal, or string of class name. - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _check_type, - None, - _request_auths, - ), - ) + :return: object. + """ + if data is None: + return None - def request( - self, - method, - url, - query_params=None, - headers=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "HEAD": - return self.rest_client.HEAD( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "OPTIONS": - return self.rest_client.OPTIONS( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "POST": - return self.rest_client.POST( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PUT": - return self.rest_client.PUT( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PATCH": - return self.rest_client.PATCH( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "DELETE": - return self.rest_client.DELETE( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + if isinstance(klass, str): + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(ibutsu_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`, `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -549,7 +445,7 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: list[tuple[str, str]] = [] if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: @@ -571,121 +467,146 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: list[tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(quote(str(value)) for value in v))) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) def files_parameters( - self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None + self, + files: dict[str, str | bytes | list[str] | list[bytes] | tuple[str, bytes]], ): """Builds form parameters. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param files: File parameters. + :return: Form parameters with files. """ - if files is None: - return [] - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values + for k, v in files.items(): + if isinstance(v, str): + with open(v, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - params.append(tuple([param_name, tuple([filename, filedata, mimetype])])) - + else: + raise ValueError("Unsupported file value") + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: list[str]) -> str | None: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search("json", accept, re.IGNORECASE): + return accept - if "application/json" in accepts: - return "application/json" - else: - return ", ".join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: return None - content_types = [x.lower() for x in content_types] - - if ( - method == "PATCH" - and "application/json-patch+json" in content_types - and isinstance(body, list) - ): - return "application/json-patch+json" + for content_type in content_types: + if re.search("json", content_type, re.IGNORECASE): + return content_type - if "application/json" in content_types or "*/*" in content_types: - return "application/json" - else: - return content_types[0] + return content_types[0] def update_params_for_auth( - self, headers, queries, auth_settings, resource_path, method, body, request_auths=None - ): + self, headers, queries, auth_settings, resource_path, method, body, request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting - ) - return + if request_auth: + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting + ) - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting - ) + def _apply_auth_params( + self, headers, queries, resource_path, method, body, auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ if auth_setting["in"] == "cookie": - headers["Cookie"] = auth_setting["key"] + "=" + auth_setting["value"] + headers["Cookie"] = auth_setting["value"] elif auth_setting["in"] == "header": if auth_setting["type"] != "http-signature": headers[auth_setting["key"]] = auth_setting["value"] @@ -694,252 +615,104 @@ def _apply_auth_params(self, headers, queries, resource_path, method, body, auth else: raise ApiValueError("Authentication token must be in `query` or `header`") + def __deserialize_file(self, response): + """Deserializes body to file -class Endpoint: - def __init__( - self, - settings=None, - params_map=None, - root_map=None, - headers_map=None, - api_client=None, - callable=None, - ): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. """ - self.settings = settings - self.params_map = params_map - self.params_map["all"].extend( - [ - "async_req", - "_host_index", - "_preload_content", - "_request_timeout", - "_return_http_data_only", - "_check_input_type", - "_check_return_type", - "_content_type", - "_spec_property_naming", - "_request_auths", - ] - ) - self.params_map["nullable"].extend(["_request_timeout"]) - self.validations = root_map["validations"] - self.allowed_values = root_map["allowed_values"] - self.openapi_types = root_map["openapi_types"] - extra_types = { - "async_req": (bool,), - "_host_index": (none_type, int), - "_preload_content": (bool,), - "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), - "_return_http_data_only": (bool,), - "_check_input_type": (bool,), - "_check_return_type": (bool,), - "_spec_property_naming": (bool,), - "_content_type": (none_type, str), - "_request_auths": (none_type, list), - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map["attribute_map"] - self.location_map = root_map["location_map"] - self.collection_format_map = root_map["collection_format_map"] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map["enum"]: - if param in kwargs: - check_allowed_values(self.allowed_values, (param,), kwargs[param]) - - for param in self.params_map["validation"]: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration, - ) + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) - if kwargs["_check_input_type"] is False: - return + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs["_spec_property_naming"], - kwargs["_check_input_type"], - configuration=self.api_client.configuration, - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - "body": None, - "collection_format": {}, - "file": {}, - "form": [], - "header": {}, - "path": {}, - "query": [], - } - - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == "body": - params["body"] = param_value - continue - base_name = self.attribute_map[param_name] - if param_location == "form" and self.openapi_types[param_name] == (file_type,): - params["file"][base_name] = [param_value] - elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): - # param_value is already a list - params["file"][base_name] = param_value - elif param_location in {"form", "query"}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {"form", "query"}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params["collection_format"][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - def __call__(self, *args, **kwargs): - """This method is invoked when endpoints are called - Example: + :param data: str. + :param klass: class literal. - api_instance = AdminProjectManagementApi() - api_instance.admin_add_project # this is an instance of the class Endpoint - api_instance.admin_add_project() # this invokes api_instance.admin_add_project.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.admin_add_project.callable or self.callable in this class + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + def __deserialize_object(self, value): + """Return an original value. + + :return: object. """ - return self.callable(self, *args, **kwargs) + return value + + def __deserialize_date(self, string): + """Deserializes string to date. - def call_with_http_info(self, **kwargs): + :param string: str. + :return: date. + """ try: - index = ( - self.api_client.configuration.server_operation_index.get( - self.settings["operation_id"], self.api_client.configuration.server_index - ) - if kwargs["_host_index"] is None - else kwargs["_host_index"] - ) - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings["operation_id"], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings["servers"] - ) - except IndexError: - if self.settings["servers"]: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]) - ) - _host = None + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException(status=0, reason=f"Failed to parse `{string}` as date object") - for key, value in kwargs.items(): - if key not in self.params_map["all"]: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % (key, self.settings["operation_id"]) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if ( - key not in self.params_map["nullable"] - and value is None - and kwargs["_check_input_type"] is False - ): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % (key, self.settings["operation_id"]) - ) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. - for key in self.params_map["required"]: - if key not in kwargs: - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings["operation_id"]) - ) + The string should be in iso8601 datetime format. - self.__validate_inputs(kwargs) + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, reason=(f"Failed to parse `{string}` as datetime object") + ) - params = self.__gather_params(kwargs) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - accept_headers_list = self.headers_map["accept"] - if accept_headers_list: - params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException(status=0, reason=(f"Failed to parse `{data}` as `{klass}`")) - if kwargs.get("_content_type"): - params["header"]["Content-Type"] = kwargs["_content_type"] - else: - content_type_headers_list = self.headers_map["content_type"] - if content_type_headers_list: - if params["body"] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings["http_method"], params["body"] - ) - if content_types_list: - params["header"]["Content-Type"] = content_types_list - - return self.api_client.call_api( - self.settings["endpoint_path"], - self.settings["http_method"], - params["path"], - params["query"], - params["header"], - body=params["body"], - post_params=params["form"], - files=params["file"], - response_type=self.settings["response_type"], - auth_settings=self.settings["auth"], - async_req=kwargs["async_req"], - _check_type=kwargs["_check_return_type"], - _return_http_data_only=kwargs["_return_http_data_only"], - _preload_content=kwargs["_preload_content"], - _request_timeout=kwargs["_request_timeout"], - _host=_host, - _request_auths=kwargs["_request_auths"], - collection_formats=params["collection_format"], - ) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/ibutsu_client/api_response.py b/ibutsu_client/api_response.py new file mode 100644 index 0000000..7cec360 --- /dev/null +++ b/ibutsu_client/api_response.py @@ -0,0 +1,23 @@ +"""API response object.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Generic, TypeVar + +from pydantic import BaseModel, Field, StrictBytes, StrictInt + +T = TypeVar("T") + + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Mapping[str, str] | None = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = {"arbitrary_types_allowed": True} diff --git a/ibutsu_client/apis/__init__.py b/ibutsu_client/apis/__init__.py deleted file mode 100644 index 195e850..0000000 --- a/ibutsu_client/apis/__init__.py +++ /dev/null @@ -1,48 +0,0 @@ -# Import all APIs into this package. -# If you have many APIs here with many many models used in each API this may -# raise a `RecursionError`. -# In order to avoid this, import only the API that you directly need like: -# -# from ibutsu_client.api.admin_project_management_api import AdminProjectManagementApi -# -# or import this package, but before doing it, use: -# -# import sys -# sys.setrecursionlimit(n) - -__all__ = [ - "AdminProjectManagementApi", - "AdminUserManagementApi", - "ArtifactApi", - "DashboardApi", - "GroupApi", - "HealthApi", - "ImportApi", - "LoginApi", - "ProjectApi", - "ReportApi", - "ResultApi", - "RunApi", - "TaskApi", - "UserApi", - "WidgetApi", - "WidgetConfigApi", -] - -# Import APIs into API package: -from ibutsu_client.api.admin_project_management_api import AdminProjectManagementApi -from ibutsu_client.api.admin_user_management_api import AdminUserManagementApi -from ibutsu_client.api.artifact_api import ArtifactApi -from ibutsu_client.api.dashboard_api import DashboardApi -from ibutsu_client.api.group_api import GroupApi -from ibutsu_client.api.health_api import HealthApi -from ibutsu_client.api.import_api import ImportApi -from ibutsu_client.api.login_api import LoginApi -from ibutsu_client.api.project_api import ProjectApi -from ibutsu_client.api.report_api import ReportApi -from ibutsu_client.api.result_api import ResultApi -from ibutsu_client.api.run_api import RunApi -from ibutsu_client.api.task_api import TaskApi -from ibutsu_client.api.user_api import UserApi -from ibutsu_client.api.widget_api import WidgetApi -from ibutsu_client.api.widget_config_api import WidgetConfigApi diff --git a/ibutsu_client/configuration.py b/ibutsu_client/configuration.py index 09572ef..bcf6220 100644 --- a/ibutsu_client/configuration.py +++ b/ibutsu_client/configuration.py @@ -3,20 +3,22 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import copy +import http.client as httplib import logging import multiprocessing import sys -from http import client as http_client +from logging import FileHandler +from typing import Any, ClassVar, Literal, NotRequired, Self, TypedDict import urllib3 -from ibutsu_client.exceptions import ApiValueError - JSON_SCHEMA_VALIDATION_KEYWORDS = { "multipleOf", "maximum", @@ -30,47 +32,119 @@ "minItems", } +ServerVariablesT = dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": str | None, + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str | None, + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +class AuthSettings(TypedDict, total=False): + jwt: BearerFormatAuthSetting + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: list[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[dict[str, HostSettingVariable]] -class Configuration: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -79,31 +153,38 @@ class Configuration: configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. :Example: """ - _default = None + _default: ClassVar[Self | None] = None def __init__( self, - host=None, - api_key=None, - api_key_prefix=None, - access_token=None, - username=None, - password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ssl_ca_cert=None, - ): + host: str | None = None, + api_key: dict[str, str] | None = None, + api_key_prefix: dict[str, str] | None = None, + username: str | None = None, + password: str | None = None, + access_token: str | None = None, + server_index: int | None = None, + server_variables: ServerVariablesT | None = None, + server_operation_index: dict[int, int] | None = None, + server_operation_variables: dict[int, ServerVariablesT] | None = None, + ignore_operation_servers: bool = False, + ssl_ca_cert: str | None = None, + retries: int | None = None, + ca_cert_data: str | bytes | None = None, + *, + debug: bool | None = None, + ) -> None: """Constructor""" self._base_path = "/api" if host is None else host """Default Base url @@ -116,11 +197,13 @@ def __init__( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -140,8 +223,9 @@ def __init__( self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -153,13 +237,16 @@ def __init__( self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: FileHandler | None = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -171,6 +258,10 @@ def __init__( self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None """client certificate file """ @@ -180,6 +271,10 @@ def __init__( self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -189,28 +284,34 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: str | None = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ self.safe_chars_for_path_param = "" """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ - def __deepcopy__(self, memo): + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -224,17 +325,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) - if name == "disabled_client_side_validations": - s = set(filter(None, value.split(","))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError(f"Invalid keyword: '{v}''") - self._disabled_client_side_validations = s @classmethod - def set_default(cls, default): + def set_default(cls, default: Self | None) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -242,24 +337,34 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() @classmethod - def get_default_copy(cls): - """Return new instance of configuration. + def get_default(cls) -> Self: + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = cls() + return cls._default @property - def logger_file(self): + def logger_file(self) -> str | None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -271,7 +376,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: str | None) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -290,7 +395,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -299,7 +404,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -310,18 +415,18 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -332,7 +437,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -343,7 +448,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: str | None = None) -> str | None: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -360,7 +465,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> str | None: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -373,12 +480,12 @@ def get_basic_auth_token(self): password = self.password return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization") - def auth_settings(self): + def auth_settings(self) -> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth["jwt"] = { "type": "bearer", @@ -389,7 +496,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -398,11 +505,11 @@ def to_debug_report(self): "Python SDK Debug Report:\n" f"OS: {sys.platform}\n" f"Python Version: {sys.version}\n" - "Version of the API: 2.3.0\n" - "SDK Package Version: 2.3.0" + "Version of the API: 2.7.4\n" + "SDK Package Version: 3.0.0" ) - def get_host_settings(self): + def get_host_settings(self) -> list[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -414,7 +521,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: int | None, + variables: ServerVariablesT | None = None, + servers: list[HostSetting] | None = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -453,12 +565,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/ibutsu_client/exceptions.py b/ibutsu_client/exceptions.py index 514a872..5ad5c34 100644 --- a/ibutsu_client/exceptions.py +++ b/ibutsu_client/exceptions.py @@ -3,17 +3,21 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ +from typing import Any, Self + class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None: """Raises an exception for TypeErrors Args: @@ -41,7 +45,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -59,7 +63,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -78,7 +82,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -95,48 +99,102 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: str | None = None, + data: Any | None = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode("utf-8") + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: str | None, + data: Any | None, + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" - error_message = f"Status Code: {self.status}\nReason: {self.reason}\n" + error_message = f"({self.status})\nReason: {self.reason}\n" if self.headers: error_message += f"HTTP response headers: {self.headers}\n" - if self.body: - error_message += f"HTTP response body: {self.body}\n" + if self.data or self.body: + error_message += f"HTTP response body: {self.data or self.body}\n" return error_message +class BadRequestException(ApiException): + pass + + class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super().__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super().__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super().__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super().__init__(status, reason, http_resp) + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" def render_path(path_to_item): diff --git a/ibutsu_client/model/__init__.py b/ibutsu_client/model/__init__.py deleted file mode 100644 index 9eadeae..0000000 --- a/ibutsu_client/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from ibutsu_client.models import ModelA, ModelB diff --git a/ibutsu_client/model/account_recovery.py b/ibutsu_client/model/account_recovery.py deleted file mode 100644 index 2630557..0000000 --- a/ibutsu_client/model/account_recovery.py +++ /dev/null @@ -1,273 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class AccountRecovery(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "email": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "email": "email", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email, *args, **kwargs): - """AccountRecovery - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, email, *args, **kwargs): - """AccountRecovery - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/account_registration.py b/ibutsu_client/model/account_registration.py deleted file mode 100644 index ce52752..0000000 --- a/ibutsu_client/model/account_registration.py +++ /dev/null @@ -1,279 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class AccountRegistration(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "email": (str,), - "password": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "email": "email", - "password": "password", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email, password, *args, **kwargs): - """AccountRegistration - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - password (str): The user's password - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, email, password, *args, **kwargs): - """AccountRegistration - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - password (str): The user's password - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/account_reset.py b/ibutsu_client/model/account_reset.py deleted file mode 100644 index fa4caac..0000000 --- a/ibutsu_client/model/account_reset.py +++ /dev/null @@ -1,279 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class AccountReset(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "activation_code": (str,), - "password": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "activation_code": "activation_code", - "password": "password", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, activation_code, password, *args, **kwargs): - """AccountReset - a model defined in OpenAPI - - Args: - activation_code (str): The activation code generated by Ibutsu - password (str): The user's password - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.activation_code = activation_code - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, activation_code, password, *args, **kwargs): - """AccountReset - a model defined in OpenAPI - - Args: - activation_code (str): The activation code generated by Ibutsu - password (str): The user's password - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.activation_code = activation_code - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/artifact.py b/ibutsu_client/model/artifact.py deleted file mode 100644 index 86e74ed..0000000 --- a/ibutsu_client/model/artifact.py +++ /dev/null @@ -1,289 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Artifact(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "result_id": (str,), - "run_id": (str,), - "filename": (str,), - "additional_metadata": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - ), - "upload_date": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "result_id": "result_id", - "run_id": "run_id", - "filename": "filename", - "additional_metadata": "additional_metadata", - "upload_date": "upload_date", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Artifact - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the artifact. [optional] - result_id (str): ID of test result to attach artifact to. [optional] - run_id (str): ID of test run to attach artifact to. [optional] - filename (str): ID of pet to update. [optional] - additional_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional data to pass to server. [optional] - upload_date (str): The date this artifact was uploaded. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Artifact - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the artifact. [optional] - result_id (str): ID of test result to attach artifact to. [optional] - run_id (str): ID of test run to attach artifact to. [optional] - filename (str): ID of pet to update. [optional] - additional_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Additional data to pass to server. [optional] - upload_date (str): The date this artifact was uploaded. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/artifact_list.py b/ibutsu_client/model/artifact_list.py deleted file mode 100644 index c86930e..0000000 --- a/ibutsu_client/model/artifact_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.artifact import Artifact - from ibutsu_client.model.pagination import Pagination - - globals()["Artifact"] = Artifact - globals()["Pagination"] = Pagination - - -class ArtifactList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "artifacts": ([Artifact],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "artifacts": "artifacts", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ArtifactList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - artifacts ([Artifact]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ArtifactList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - artifacts ([Artifact]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/create_token.py b/ibutsu_client/model/create_token.py deleted file mode 100644 index 82e1b6f..0000000 --- a/ibutsu_client/model/create_token.py +++ /dev/null @@ -1,282 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class CreateToken(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), - "expires": ( - str, - none_type, - ), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", - "expires": "expires", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, expires, *args, **kwargs): - """CreateToken - a model defined in OpenAPI - - Args: - name (str): The name given to this token - expires (str, none_type): The date and time when this token expires - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.expires = expires - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, name, expires, *args, **kwargs): - """CreateToken - a model defined in OpenAPI - - Args: - name (str): The name given to this token - expires (str, none_type): The date and time when this token expires - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.expires = expires - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/credentials.py b/ibutsu_client/model/credentials.py deleted file mode 100644 index 47e223a..0000000 --- a/ibutsu_client/model/credentials.py +++ /dev/null @@ -1,279 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Credentials(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "email": (str,), - "password": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "email": "email", - "password": "password", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email, password, *args, **kwargs): - """Credentials - a model defined in OpenAPI - - Args: - email (str): The e-mail address of the user - password (str): The password for the user - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, email, password, *args, **kwargs): - """Credentials - a model defined in OpenAPI - - Args: - email (str): The e-mail address of the user - password (str): The password for the user - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - self.password = password - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/dashboard.py b/ibutsu_client/model/dashboard.py deleted file mode 100644 index e000c6e..0000000 --- a/ibutsu_client/model/dashboard.py +++ /dev/null @@ -1,287 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Dashboard(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "title": (str,), - "description": (str,), - "filters": (str,), - "project_id": (str,), - "user_id": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "title": "title", - "description": "description", - "filters": "filters", - "project_id": "project_id", - "user_id": "user_id", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Dashboard - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the dashboard. [optional] - title (str): The title of the dashboard. [optional] - description (str): A basic description of the dashboard. [optional] - filters (str): An optional set of filters. [optional] - project_id (str): The ID of the project this dashboard is associated with. [optional] - user_id (str): The ID of a user this dashboard might be associated with. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Dashboard - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the dashboard. [optional] - title (str): The title of the dashboard. [optional] - description (str): A basic description of the dashboard. [optional] - filters (str): An optional set of filters. [optional] - project_id (str): The ID of the project this dashboard is associated with. [optional] - user_id (str): The ID of a user this dashboard might be associated with. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/dashboard_list.py b/ibutsu_client/model/dashboard_list.py deleted file mode 100644 index 5459194..0000000 --- a/ibutsu_client/model/dashboard_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.dashboard import Dashboard - from ibutsu_client.model.pagination import Pagination - - globals()["Dashboard"] = Dashboard - globals()["Pagination"] = Pagination - - -class DashboardList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "dashboards": ([Dashboard],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "dashboards": "dashboards", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """DashboardList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - dashboards ([Dashboard]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """DashboardList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - dashboards ([Dashboard]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/get_report_types200_response_inner.py b/ibutsu_client/model/get_report_types200_response_inner.py deleted file mode 100644 index f9e67cd..0000000 --- a/ibutsu_client/model/get_report_types200_response_inner.py +++ /dev/null @@ -1,271 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class GetReportTypes200ResponseInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "type": (str,), - "name": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "type": "type", - "name": "name", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """GetReportTypes200ResponseInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): The machine-readable name of report type. [optional] - name (str): The human-readable name of report type. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """GetReportTypes200ResponseInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): The machine-readable name of report type. [optional] - name (str): The human-readable name of report type. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/group.py b/ibutsu_client/model/group.py deleted file mode 100644 index 79ffd69..0000000 --- a/ibutsu_client/model/group.py +++ /dev/null @@ -1,271 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Group(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "name": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "name": "name", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Group - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the group. [optional] - name (str): The name of the group. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Group - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the group. [optional] - name (str): The name of the group. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/group_list.py b/ibutsu_client/model/group_list.py deleted file mode 100644 index fc30a54..0000000 --- a/ibutsu_client/model/group_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.group import Group - from ibutsu_client.model.pagination import Pagination - - globals()["Group"] = Group - globals()["Pagination"] = Pagination - - -class GroupList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "groups": ([Group],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "groups": "groups", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """GroupList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - groups ([Group]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """GroupList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - groups ([Group]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/health.py b/ibutsu_client/model/health.py deleted file mode 100644 index 7e10176..0000000 --- a/ibutsu_client/model/health.py +++ /dev/null @@ -1,271 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Health(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "status": (str,), - "message": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "status": "status", - "message": "message", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Health - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - status (str): The status of the database, one of \"OK\", \"Error\", \"Pending\". [optional] - message (str): A message to explain the current status. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Health - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - status (str): The status of the database, one of \"OK\", \"Error\", \"Pending\". [optional] - message (str): A message to explain the current status. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/health_info.py b/ibutsu_client/model/health_info.py deleted file mode 100644 index 1d9529d..0000000 --- a/ibutsu_client/model/health_info.py +++ /dev/null @@ -1,275 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class HealthInfo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "frontend": (str,), - "backend": (str,), - "api_ui": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "frontend": "frontend", - "backend": "backend", - "api_ui": "api_ui", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """HealthInfo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - frontend (str): The URL of the frontend. [optional] - backend (str): The URL of the backend. [optional] - api_ui (str): The URL to the UI for the API. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """HealthInfo - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - frontend (str): The URL of the frontend. [optional] - backend (str): The URL of the backend. [optional] - api_ui (str): The URL to the UI for the API. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/login_config.py b/ibutsu_client/model/login_config.py deleted file mode 100644 index 332b330..0000000 --- a/ibutsu_client/model/login_config.py +++ /dev/null @@ -1,275 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class LoginConfig(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "client_id": (str,), - "redirect_uri": (str,), - "scope": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "client_id": "client_id", - "redirect_uri": "redirect_uri", - "scope": "scope", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LoginConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): The client ID for the provider. [optional] - redirect_uri (str): The redirect URI for the provider to call back. [optional] - scope (str): The OAuth2 permission scope. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LoginConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - client_id (str): The client ID for the provider. [optional] - redirect_uri (str): The redirect URI for the provider to call back. [optional] - scope (str): The OAuth2 permission scope. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/login_error.py b/ibutsu_client/model/login_error.py deleted file mode 100644 index 98c60fd..0000000 --- a/ibutsu_client/model/login_error.py +++ /dev/null @@ -1,271 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class LoginError(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "code": (str,), - "message": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "code": "code", - "message": "message", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LoginError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (str): An error code generated by the server. [optional] - message (str): The error message that corresponds with the error code. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LoginError - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - code (str): An error code generated by the server. [optional] - message (str): The error message that corresponds with the error code. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/login_support.py b/ibutsu_client/model/login_support.py deleted file mode 100644 index 2a8d598..0000000 --- a/ibutsu_client/model/login_support.py +++ /dev/null @@ -1,287 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class LoginSupport(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "user": (bool,), - "keycloak": (bool,), - "google": (bool,), - "github": (bool,), - "facebook": (bool,), - "gitlab": (bool,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "user": "user", - "keycloak": "keycloak", - "google": "google", - "github": "github", - "facebook": "facebook", - "gitlab": "gitlab", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LoginSupport - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - user (bool): Flag to see if email/password login is available. [optional] - keycloak (bool): Flag to see if Keycloak login is available. [optional] - google (bool): Flag to see if Google login is available. [optional] - github (bool): Flag to see if GitHub login is available. [optional] - facebook (bool): Flag to see if Facebook login is available. [optional] - gitlab (bool): Flag to see if GitLab login is available. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LoginSupport - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - user (bool): Flag to see if email/password login is available. [optional] - keycloak (bool): Flag to see if Keycloak login is available. [optional] - google (bool): Flag to see if Google login is available. [optional] - github (bool): Flag to see if GitHub login is available. [optional] - facebook (bool): Flag to see if Facebook login is available. [optional] - gitlab (bool): Flag to see if GitLab login is available. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/login_token.py b/ibutsu_client/model/login_token.py deleted file mode 100644 index 55360e8..0000000 --- a/ibutsu_client/model/login_token.py +++ /dev/null @@ -1,267 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class LoginToken(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "token": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "token": "token", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """LoginToken - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - token (str): The JWT token returned from a successful login. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """LoginToken - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - token (str): The JWT token returned from a successful login. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/model_import.py b/ibutsu_client/model/model_import.py deleted file mode 100644 index f57cb1a..0000000 --- a/ibutsu_client/model/model_import.py +++ /dev/null @@ -1,283 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class ModelImport(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "status": (str,), - "filename": (str,), - "format": (str,), - "run_id": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "status": "status", - "filename": "filename", - "format": "format", - "run_id": "run_id", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ModelImport - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The database ID of the import. [optional] - status (str): The current status of the import, can be one of \"pending\", \"running\", \"done\". [optional] - filename (str): The name of the file that was uploaded. [optional] - format (str): The format of the file uploaded. [optional] - run_id (str): The ID of the run from the import. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ModelImport - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The database ID of the import. [optional] - status (str): The current status of the import, can be one of \"pending\", \"running\", \"done\". [optional] - filename (str): The name of the file that was uploaded. [optional] - format (str): The format of the file uploaded. [optional] - run_id (str): The ID of the run from the import. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/pagination.py b/ibutsu_client/model/pagination.py deleted file mode 100644 index 352fedc..0000000 --- a/ibutsu_client/model/pagination.py +++ /dev/null @@ -1,279 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Pagination(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "page": (int,), - "page_size": (int,), - "total_pages": (int,), - "total_items": (int,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "page": "page", - "page_size": "pageSize", - "total_pages": "totalPages", - "total_items": "totalItems", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Pagination - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - page (int): The current page number. [optional] - page_size (int): The number of items per page. [optional] - total_pages (int): The total number of pages. [optional] - total_items (int): The total number of items for this query. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Pagination - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - page (int): The current page number. [optional] - page_size (int): The number of items per page. [optional] - total_pages (int): The total number of pages. [optional] - total_items (int): The total number of items for this query. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/project.py b/ibutsu_client/model/project.py deleted file mode 100644 index 181a243..0000000 --- a/ibutsu_client/model/project.py +++ /dev/null @@ -1,289 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Project(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "name": (str,), - "title": (str,), - "owner_id": ( - str, - none_type, - ), - "group_id": ( - str, - none_type, - ), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "name": "name", - "title": "title", - "owner_id": "owner_id", - "group_id": "group_id", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Project - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the project. [optional] - name (str): The machine name of the project. [optional] - title (str): The human-readable title of the project. [optional] - owner_id (str, none_type): The ID of the owner of this project. [optional] - group_id (str, none_type): The ID of the group of this project. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Project - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the project. [optional] - name (str): The machine name of the project. [optional] - title (str): The human-readable title of the project. [optional] - owner_id (str, none_type): The ID of the owner of this project. [optional] - group_id (str, none_type): The ID of the group of this project. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/project_list.py b/ibutsu_client/model/project_list.py deleted file mode 100644 index ae071d3..0000000 --- a/ibutsu_client/model/project_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.project import Project - - globals()["Pagination"] = Pagination - globals()["Project"] = Project - - -class ProjectList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "projects": ([Project],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "projects": "projects", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ProjectList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - projects ([Project]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ProjectList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - projects ([Project]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/report.py b/ibutsu_client/model/report.py deleted file mode 100644 index c0611cc..0000000 --- a/ibutsu_client/model/report.py +++ /dev/null @@ -1,303 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.report_parameters import ReportParameters - - globals()["ReportParameters"] = ReportParameters - - -class Report(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (str,), - "filename": (str,), - "mimetype": (str,), - "url": (str,), - "download_url": (str,), - "view_url": (str,), - "parameters": (ReportParameters,), - "status": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "filename": "filename", - "mimetype": "mimetype", - "url": "url", - "download_url": "download_url", - "view_url": "view_url", - "parameters": "parameters", - "status": "status", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Report - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the report. [optional] - filename (str): The filename of the report. [optional] - mimetype (str): The mime type of the downloadable file. [optional] - url (str): The URL to the downloadable report (deprecated). [optional] - download_url (str): The URL to the downloadable report. [optional] - view_url (str): The URL to the viewable report. [optional] - parameters (ReportParameters): [optional] - status (str): The status of the report, one of \"pending\", \"running\", \"done\". [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Report - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the report. [optional] - filename (str): The filename of the report. [optional] - mimetype (str): The mime type of the downloadable file. [optional] - url (str): The URL to the downloadable report (deprecated). [optional] - download_url (str): The URL to the downloadable report. [optional] - view_url (str): The URL to the viewable report. [optional] - parameters (ReportParameters): [optional] - status (str): The status of the report, one of \"pending\", \"running\", \"done\". [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/report_list.py b/ibutsu_client/model/report_list.py deleted file mode 100644 index 3ffbc51..0000000 --- a/ibutsu_client/model/report_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.report import Report - - globals()["Pagination"] = Pagination - globals()["Report"] = Report - - -class ReportList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "reports": ([Report],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "reports": "reports", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ReportList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - reports ([Report]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ReportList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - reports ([Report]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/report_parameters.py b/ibutsu_client/model/report_parameters.py deleted file mode 100644 index d5f1af6..0000000 --- a/ibutsu_client/model/report_parameters.py +++ /dev/null @@ -1,275 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class ReportParameters(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "type": (str,), - "filter": (str,), - "source": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "type": "type", - "filter": "filter", - "source": "source", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ReportParameters - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): The type of report to generate. [optional] - filter (str): A regular expression to filter test results by. [optional] - source (str): The source of the test results. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ReportParameters - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - type (str): The type of report to generate. [optional] - filter (str): A regular expression to filter test results by. [optional] - source (str): The source of the test results. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/result.py b/ibutsu_client/model/result.py deleted file mode 100644 index fde2bd7..0000000 --- a/ibutsu_client/model/result.py +++ /dev/null @@ -1,334 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Result(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ("result",): { - "PASSED": "passed", - "FAILED": "failed", - "ERROR": "error", - "SKIPPED": "skipped", - "XPASSED": "xpassed", - "XFAILED": "xfailed", - "MANUAL": "manual", - "BLOCKED": "blocked", - }, - } - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "test_id": (str,), - "start_time": (str,), - "duration": (float,), - "result": (str,), - "component": ( - str, - none_type, - ), - "env": ( - str, - none_type, - ), - "run_id": ( - str, - none_type, - ), - "project_id": ( - str, - none_type, - ), - "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - "params": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - "source": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "test_id": "test_id", - "start_time": "start_time", - "duration": "duration", - "result": "result", - "component": "component", - "env": "env", - "run_id": "run_id", - "project_id": "project_id", - "metadata": "metadata", - "params": "params", - "source": "source", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Result - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the test result. [optional] - test_id (str): Unique id. [optional] - start_time (str): Timestamp of starttime.. [optional] - duration (float): Duration of test in seconds.. [optional] - result (str): Status of result.. [optional] - component (str, none_type): A component. [optional] - env (str, none_type): The environment which is being tested. [optional] - run_id (str, none_type): The run this result is associated with. [optional] - project_id (str, none_type): The project this run is associated with. [optional] - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - source (str): Where the data came from (useful for filtering). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Result - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the test result. [optional] - test_id (str): Unique id. [optional] - start_time (str): Timestamp of starttime.. [optional] - duration (float): Duration of test in seconds.. [optional] - result (str): Status of result.. [optional] - component (str, none_type): A component. [optional] - env (str, none_type): The environment which is being tested. [optional] - run_id (str, none_type): The run this result is associated with. [optional] - project_id (str, none_type): The project this run is associated with. [optional] - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - source (str): Where the data came from (useful for filtering). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/result_list.py b/ibutsu_client/model/result_list.py deleted file mode 100644 index 850fc5c..0000000 --- a/ibutsu_client/model/result_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.result import Result - - globals()["Pagination"] = Pagination - globals()["Result"] = Result - - -class ResultList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "results": ([Result],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "results": "results", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """ResultList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - results ([Result]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """ResultList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - results ([Result]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/run.py b/ibutsu_client/model/run.py deleted file mode 100644 index e9cc467..0000000 --- a/ibutsu_client/model/run.py +++ /dev/null @@ -1,318 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Run(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "created": (str,), - "duration": (float,), - "source": ( - str, - none_type, - ), - "start_time": (str,), - "component": ( - str, - none_type, - ), - "env": ( - str, - none_type, - ), - "project_id": ( - str, - none_type, - ), - "summary": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - "metadata": ( - {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, - none_type, - ), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "created": "created", - "duration": "duration", - "source": "source", - "start_time": "start_time", - "component": "component", - "env": "env", - "project_id": "project_id", - "summary": "summary", - "metadata": "metadata", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """Run - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the test run. [optional] - created (str): The time this record was created. [optional] - duration (float): Duration of tests in seconds. [optional] - source (str, none_type): A source for this test run. [optional] - start_time (str): The time the test run started. [optional] - component (str, none_type): A component. [optional] - env (str, none_type): The environment which is being tested. [optional] - project_id (str, none_type): The project this run is associated with. [optional] - summary ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A summary of the test results. [optional] - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Extra metadata for this run. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """Run - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): Unique ID of the test run. [optional] - created (str): The time this record was created. [optional] - duration (float): Duration of tests in seconds. [optional] - source (str, none_type): A source for this test run. [optional] - start_time (str): The time the test run started. [optional] - component (str, none_type): A component. [optional] - env (str, none_type): The environment which is being tested. [optional] - project_id (str, none_type): The project this run is associated with. [optional] - summary ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A summary of the test results. [optional] - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Extra metadata for this run. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/run_list.py b/ibutsu_client/model/run_list.py deleted file mode 100644 index 0ed1776..0000000 --- a/ibutsu_client/model/run_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.run import Run - - globals()["Pagination"] = Pagination - globals()["Run"] = Run - - -class RunList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "runs": ([Run],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "runs": "runs", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """RunList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - runs ([Run]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """RunList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - runs ([Run]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/token.py b/ibutsu_client/model/token.py deleted file mode 100644 index d6a2fa0..0000000 --- a/ibutsu_client/model/token.py +++ /dev/null @@ -1,298 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class Token(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "user_id": (str,), - "name": (str,), - "token": (str,), - "expires": ( - str, - none_type, - ), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "user_id": "user_id", - "name": "name", - "token": "token", - "expires": "expires", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, id, user_id, name, token, *args, **kwargs): - """Token - a model defined in OpenAPI - - Args: - id (str): The ID of the token - user_id (str): The ID of the user that owns this token - name (str): The name given to this token - token (str): The token itself - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - expires (str, none_type): The date and time when this token expires. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.user_id = user_id - self.name = name - self.token = token - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, id, user_id, name, token, *args, **kwargs): - """Token - a model defined in OpenAPI - - Args: - id (str): The ID of the token - user_id (str): The ID of the user that owns this token - name (str): The name given to this token - token (str): The token itself - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - expires (str, none_type): The date and time when this token expires. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.id = id - self.user_id = user_id - self.name = name - self.token = token - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/token_list.py b/ibutsu_client/model/token_list.py deleted file mode 100644 index 99e0d8a..0000000 --- a/ibutsu_client/model/token_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.token import Token - - globals()["Pagination"] = Pagination - globals()["Token"] = Token - - -class TokenList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "tokens": ([Token],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "tokens": "tokens", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """TokenList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tokens ([Token]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """TokenList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - tokens ([Token]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/update_run.py b/ibutsu_client/model/update_run.py deleted file mode 100644 index f7637e1..0000000 --- a/ibutsu_client/model/update_run.py +++ /dev/null @@ -1,267 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class UpdateRun(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "metadata": "metadata", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """UpdateRun - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Extra data for this run. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """UpdateRun - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Extra data for this run. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/user.py b/ibutsu_client/model/user.py deleted file mode 100644 index ae5759c..0000000 --- a/ibutsu_client/model/user.py +++ /dev/null @@ -1,299 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "email": (str,), - "id": (str,), - "name": ( - str, - none_type, - ), - "is_superadmin": (bool,), - "is_active": (bool,), - "group_id": ( - str, - none_type, - ), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "email": "email", - "id": "id", - "name": "name", - "is_superadmin": "is_superadmin", - "is_active": "is_active", - "group_id": "group_id", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email, *args, **kwargs): - """User - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The ID of the user. [optional] - name (str, none_type): The user's name. [optional] - is_superadmin (bool): Flag to show if a user is a super-admin. [optional] - is_active (bool): Flag to show if the user is active. [optional] - group_id (str, none_type): The ID of the group of this project. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, email, *args, **kwargs): - """User - a model defined in OpenAPI - - Args: - email (str): The user's e-mail address - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The ID of the user. [optional] - name (str, none_type): The user's name. [optional] - is_superadmin (bool): Flag to show if a user is a super-admin. [optional] - is_active (bool): Flag to show if the user is active. [optional] - group_id (str, none_type): The ID of the group of this project. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.email = email - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/user_list.py b/ibutsu_client/model/user_list.py deleted file mode 100644 index 90406b5..0000000 --- a/ibutsu_client/model/user_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.user import User - - globals()["Pagination"] = Pagination - globals()["User"] = User - - -class UserList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "users": ([User],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "users": "users", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """UserList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - users ([User]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """UserList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - users ([User]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/widget_config.py b/ibutsu_client/model/widget_config.py deleted file mode 100644 index 6e7cc4d..0000000 --- a/ibutsu_client/model/widget_config.py +++ /dev/null @@ -1,291 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class WidgetConfig(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "id": (str,), - "type": (str,), - "widget": (str,), - "project_id": (str,), - "weight": (int,), - "params": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - "title": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "type": "type", - "widget": "widget", - "project_id": "project_id", - "weight": "weight", - "params": "params", - "title": "title", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """WidgetConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The internal ID of the WidgetConfig. [optional] - type (str): The type of widget, one of either \"widget\" or \"view\". [optional] - widget (str): The widget to render, from the list at /widget/types. [optional] - project_id (str): The project ID for which the widget is designed. [optional] - weight (int): The weighting for the widget, lower weight means it will display first. [optional] - params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A dictionary of parameters to send to the widget. [optional] - title (str): The title shown on the widget or page. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """WidgetConfig - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): The internal ID of the WidgetConfig. [optional] - type (str): The type of widget, one of either \"widget\" or \"view\". [optional] - widget (str): The widget to render, from the list at /widget/types. [optional] - project_id (str): The project ID for which the widget is designed. [optional] - weight (int): The weighting for the widget, lower weight means it will display first. [optional] - params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A dictionary of parameters to send to the widget. [optional] - title (str): The title shown on the widget or page. [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/widget_config_list.py b/ibutsu_client/model/widget_config_list.py deleted file mode 100644 index a38d303..0000000 --- a/ibutsu_client/model/widget_config_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.widget_config import WidgetConfig - - globals()["Pagination"] = Pagination - globals()["WidgetConfig"] = WidgetConfig - - -class WidgetConfigList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "widgets": ([WidgetConfig],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "widgets": "widgets", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """WidgetConfigList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - widgets ([WidgetConfig]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """WidgetConfigList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - widgets ([WidgetConfig]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/widget_param.py b/ibutsu_client/model/widget_param.py deleted file mode 100644 index 1c09c59..0000000 --- a/ibutsu_client/model/widget_param.py +++ /dev/null @@ -1,275 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -class WidgetParam(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - "name": (str,), - "description": (str,), - "type": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "name": "name", - "description": "description", - "type": "type", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """WidgetParam - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the parameter to supply to the widget. [optional] - description (str): A friendly description of the parameter. [optional] - type (str): The type of parameter (string, integer, etc). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """WidgetParam - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - name (str): The name of the parameter to supply to the widget. [optional] - description (str): A friendly description of the parameter. [optional] - type (str): The type of parameter (string, integer, etc). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/widget_type.py b/ibutsu_client/model/widget_type.py deleted file mode 100644 index 0d6b450..0000000 --- a/ibutsu_client/model/widget_type.py +++ /dev/null @@ -1,291 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.widget_param import WidgetParam - - globals()["WidgetParam"] = WidgetParam - - -class WidgetType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "id": (str,), - "title": (str,), - "description": (str,), - "params": ([WidgetParam],), - "type": (str,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "id": "id", - "title": "title", - "description": "description", - "params": "params", - "type": "type", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """WidgetType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): A unique identifier for this widget type. [optional] - title (str): The title of the widget, for users to see. [optional] - description (str): A helpful description of this widget type. [optional] - params ([WidgetParam]): A dictionary or map of parameters to values. [optional] - type (str): The type of widget (widget, view). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """WidgetType - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - id (str): A unique identifier for this widget type. [optional] - title (str): The title of the widget, for users to see. [optional] - description (str): A helpful description of this widget type. [optional] - params ([WidgetParam]): A dictionary or map of parameters to values. [optional] - type (str): The type of widget (widget, view). [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model/widget_type_list.py b/ibutsu_client/model/widget_type_list.py deleted file mode 100644 index 88b93a9..0000000 --- a/ibutsu_client/model/widget_type_list.py +++ /dev/null @@ -1,281 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -from ibutsu_client.exceptions import ApiAttributeError -from ibutsu_client.model_utils import ( - ApiTypeError, - ModelNormal, - OpenApiModel, - cached_property, - convert_js_args_to_python_args, - date, - datetime, - none_type, -) - - -def lazy_import(): - from ibutsu_client.model.pagination import Pagination - from ibutsu_client.model.widget_type import WidgetType - - globals()["Pagination"] = Pagination - globals()["WidgetType"] = WidgetType - - -class WidgetTypeList(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = {} - - validations = {} - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ) - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - "types": ([WidgetType],), - "pagination": (Pagination,), - } - - @cached_property - def discriminator(): - return None - - attribute_map = { - "types": "types", - "pagination": "pagination", - } - - read_only_vars = {} - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): - """WidgetTypeList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - types ([WidgetType]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", True) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = { - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - } - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): - """WidgetTypeList - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - types ([WidgetType]): [optional] - pagination (Pagination): [optional] - """ - - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) diff --git a/ibutsu_client/model_utils.py b/ibutsu_client/model_utils.py deleted file mode 100644 index 4c124db..0000000 --- a/ibutsu_client/model_utils.py +++ /dev/null @@ -1,2001 +0,0 @@ -""" -Ibutsu API - -A system to store and query test results - -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech -""" - -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid -from copy import deepcopy -from datetime import date, datetime - -from dateutil.parser import parse - -from ibutsu_client.exceptions import ( - ApiAttributeError, - ApiKeyError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get("_spec_property_naming", False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance(_self, type) else _self.__class__ - ) - return fn(_self, *args, **kwargs) - - return wrapped_init - - -class cached_property: - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = "_results" - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas["oneOf"]: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas["oneOf"]: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel: - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - f"{type(self).__name__} has no attribute '{name}'", path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, var_value=name, valid_classes=(str,), key_type=True - ) - raise ApiTypeError( - error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, - required_types_mixed, - path_to_item, - self._spec_property_naming, - self._check_type, - configuration=self._configuration, - ) - if (name,) in self.allowed_values: - check_allowed_values(self.allowed_values, (name,), value) - if (name,) in self.validations: - check_validations(self.validations, (name,), value, self._configuration) - self.__dict__["_data_store"][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super().__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" - % (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" - % (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super().__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get("allOf") and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super().__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get("_path_to_item", ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" - % (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get("_path_to_item", ()) - disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" - % (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get("allOf") and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - f"{type(self).__name__} has no attribute '{name}'", - [e for e in [self._path_to_item, name] if e], - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store["value"] - that_val = other._data_store["value"] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__["_data_store"].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - f"{type(self).__name__} has no attribute '{name}'", - [e for e in [self._path_to_item, name] if e], - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__["_data_store"] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - f"{type(self).__name__} has no attribute '{name}'", - [e for e in [self._path_to_item, name] if e], - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - f"Values stored for property {name} in {type(self).__name__} differ when looking " - "at self and self's composed instances. All values must be " - "the same", - [e for e in [self._path_to_item, name] if e], - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - f"{type(self).__name__} has no attribute '{name}'", - [e for e in [self._path_to_item, name] if e], - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances - ) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type), - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if isinstance(input_values, list) and not set(input_values).issubset( - set(these_allowed_values) - ): - invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) - ) - elif isinstance(input_values, dict) and not set(input_values.keys()).issubset( - set(these_allowed_values) - ): - invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) - ) - elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values: - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" - % (input_variable_path[0], input_values, these_allowed_values) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return ( - configuration is None - or not hasattr(configuration, "_disabled_client_side_validations") - or schema_keyword not in configuration._disabled_client_side_validations - ) - - -def check_validations(validations, input_variable_path, input_values, configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - if input_values is None: - return - - current_validations = validations[input_variable_path] - if ( - is_json_validation_enabled("multipleOf", configuration) - and "multiple_of" in current_validations - and isinstance(input_values, (int, float)) - and not (float(input_values) / current_validations["multiple_of"]).is_integer() - ): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % (input_variable_path[0], current_validations["multiple_of"]) - ) - - if ( - is_json_validation_enabled("maxLength", configuration) - and "max_length" in current_validations - and len(input_values) > current_validations["max_length"] - ): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["max_length"]) - ) - - if ( - is_json_validation_enabled("minLength", configuration) - and "min_length" in current_validations - and len(input_values) < current_validations["min_length"] - ): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % (input_variable_path[0], current_validations["min_length"]) - ) - - if ( - is_json_validation_enabled("maxItems", configuration) - and "max_items" in current_validations - and len(input_values) > current_validations["max_items"] - ): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % (input_variable_path[0], current_validations["max_items"]) - ) - - if ( - is_json_validation_enabled("minItems", configuration) - and "min_items" in current_validations - and len(input_values) < current_validations["min_items"] - ): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % (input_variable_path[0], current_validations["min_items"]) - ) - - items = ("exclusive_maximum", "inclusive_maximum", "exclusive_minimum", "inclusive_minimum") - if any(item in current_validations for item in items): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if ( - is_json_validation_enabled("exclusiveMaximum", configuration) - and "exclusive_maximum" in current_validations - and max_val >= current_validations["exclusive_maximum"] - ): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("maximum", configuration) - and "inclusive_maximum" in current_validations - and max_val > current_validations["inclusive_maximum"] - ): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % (input_variable_path[0], current_validations["inclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("exclusiveMinimum", configuration) - and "exclusive_minimum" in current_validations - and min_val <= current_validations["exclusive_minimum"] - ): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" - % (input_variable_path[0], current_validations["exclusive_maximum"]) - ) - - if ( - is_json_validation_enabled("minimum", configuration) - and "inclusive_minimum" in current_validations - and min_val < current_validations["inclusive_minimum"] - ): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % (input_variable_path[0], current_validations["inclusive_minimum"]) - ) - flags = current_validations.get("regex", {}).get("flags", 0) - if ( - is_json_validation_enabled("pattern", configuration) - and "regex" in current_validations - and not re.search(current_validations["regex"]["pattern"], input_values, flags=flags) - ): - err_msg = r"Invalid value for `{}`, must match regular expression `{}`".format( - input_variable_path[0], - current_validations["regex"]["pattern"], - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = rf"{err_msg} with flags=`{flags}`" - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelComposed): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelNormal): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible( - required_types_classes, current_item, spec_property_naming, must_convert=True -): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if ( - must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming] - ) or class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, "discriminator") and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, "attribute_map", None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type, - ) - return ApiTypeError( - error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 - and parsed_datetime.minute == 0 - and parsed_datetime.second == 0 - and parsed_datetime.tzinfo is None - and 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError("This is not a float") - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - f"{additional_message}Failed to parse {data!r} as {klass.__name__}", - path_to_item=path_to_item, - ) from ex - - -def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get( - "oneOf", () - ) + model_class._composed_schemas.get("anyOf", ()) - ancestor_classes = model_class._composed_schemas.get("allOf", ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, "discriminator") and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited - ) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model( - model_data, model_class, path_to_item, check_type, configuration, spec_property_naming -): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict( - _check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming, - ) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition, flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode("utf-8") - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=True, -): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming - ) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model( - input_value, - valid_class, - path_to_item, - check_type, - configuration, - spec_property_naming, - ) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get("oneOf", ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get("anyOf", ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and valid_classes == ( - bool, - date, - datetime, - dict, - float, - int, - list, - str, - none_type, - ): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type - ): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = valid_class.discriminator[discr_propertyname_py].values() - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types( - input_value, - required_types_mixed, - path_to_item, - spec_property_naming, - _check_type, - configuration=None, -): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if configuration or (input_class_simple == dict and dict not in valid_classes): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type, - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False - ) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type, - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get(type(input_value)) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration, - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration, - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): - return ( - (item[0], model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], "_data_store") - else item - ) - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - elif isinstance(v, dict): - res.append(dict(map(extract_item, v.items()))) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res - elif isinstance(value, dict): - result[attr] = dict(map(extract_item, value.items())) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, "_data_store"): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = "value" - if key_type: - key_or_value = "key" - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - f"Invalid type for variable '{var_name}'. Required {key_or_value} type {valid_classes_phrase} and " - f"passed type was {type(var_value).__name__}" - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed""" - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return f"is {all_class_names[0]}" - return "is one of [{}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas["allOf"]: - try: - if constant_args.get("_spec_property_naming"): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" - % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas["oneOf"]) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas["oneOf"]: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get("_spec_property_naming"): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs - ) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get("_spec_property_naming"): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs - ) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs["_path_to_item"], - constant_kwargs["_spec_property_naming"], - constant_kwargs["_check_type"], - configuration=constant_kwargs["_configuration"], - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas["anyOf"]) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas["anyOf"]: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get("_spec_property_naming"): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas["allOf"]: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter(lambda x: prop_name in x.openapi_types, composed_instances) - ) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args, - ] diff --git a/ibutsu_client/models/__init__.py b/ibutsu_client/models/__init__.py index af15935..abaec4f 100644 --- a/ibutsu_client/models/__init__.py +++ b/ibutsu_client/models/__init__.py @@ -1,90 +1,108 @@ -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from ibutsu_client.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) +# flake8: noqa +""" +Ibutsu API -__all__ = [ - "AccountRecovery", - "AccountRegistration", - "AccountReset", - "Artifact", - "ArtifactList", - "CreateToken", - "Credentials", - "Dashboard", - "DashboardList", - "GetReportTypes200ResponseInner", - "Group", - "GroupList", - "Health", - "HealthInfo", - "LoginConfig", - "LoginError", - "LoginSupport", - "LoginToken", - "ModelImport", - "Pagination", - "Project", - "ProjectList", - "Report", - "ReportList", - "ReportParameters", - "Result", - "ResultList", - "Run", - "RunList", - "Token", - "TokenList", - "UpdateRun", - "User", - "UserList", - "WidgetConfig", - "WidgetConfigList", - "WidgetParam", - "WidgetType", - "WidgetTypeList", -] +A system to store and query test results -from ibutsu_client.model.account_recovery import AccountRecovery -from ibutsu_client.model.account_registration import AccountRegistration -from ibutsu_client.model.account_reset import AccountReset -from ibutsu_client.model.artifact import Artifact -from ibutsu_client.model.artifact_list import ArtifactList -from ibutsu_client.model.create_token import CreateToken -from ibutsu_client.model.credentials import Credentials -from ibutsu_client.model.dashboard import Dashboard -from ibutsu_client.model.dashboard_list import DashboardList -from ibutsu_client.model.get_report_types200_response_inner import GetReportTypes200ResponseInner -from ibutsu_client.model.group import Group -from ibutsu_client.model.group_list import GroupList -from ibutsu_client.model.health import Health -from ibutsu_client.model.health_info import HealthInfo -from ibutsu_client.model.login_config import LoginConfig -from ibutsu_client.model.login_error import LoginError -from ibutsu_client.model.login_support import LoginSupport -from ibutsu_client.model.login_token import LoginToken -from ibutsu_client.model.model_import import ModelImport -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.project import Project -from ibutsu_client.model.project_list import ProjectList -from ibutsu_client.model.report import Report -from ibutsu_client.model.report_list import ReportList -from ibutsu_client.model.report_parameters import ReportParameters -from ibutsu_client.model.result import Result -from ibutsu_client.model.result_list import ResultList -from ibutsu_client.model.run import Run -from ibutsu_client.model.run_list import RunList -from ibutsu_client.model.token import Token -from ibutsu_client.model.token_list import TokenList -from ibutsu_client.model.update_run import UpdateRun -from ibutsu_client.model.user import User -from ibutsu_client.model.user_list import UserList -from ibutsu_client.model.widget_config import WidgetConfig -from ibutsu_client.model.widget_config_list import WidgetConfigList -from ibutsu_client.model.widget_param import WidgetParam -from ibutsu_client.model.widget_type import WidgetType -from ibutsu_client.model.widget_type_list import WidgetTypeList +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +if __import__("typing").TYPE_CHECKING: + # import models into model package + from ibutsu_client.models.account_recovery import AccountRecovery + from ibutsu_client.models.account_registration import AccountRegistration + from ibutsu_client.models.account_reset import AccountReset + from ibutsu_client.models.artifact import Artifact + from ibutsu_client.models.artifact_list import ArtifactList + from ibutsu_client.models.create_token import CreateToken + from ibutsu_client.models.credentials import Credentials + from ibutsu_client.models.dashboard import Dashboard + from ibutsu_client.models.dashboard_list import DashboardList + from ibutsu_client.models.get_report_types200_response_inner import ( + GetReportTypes200ResponseInner, + ) + from ibutsu_client.models.group import Group + from ibutsu_client.models.group_list import GroupList + from ibutsu_client.models.health import Health + from ibutsu_client.models.health_info import HealthInfo + from ibutsu_client.models.login_config import LoginConfig + from ibutsu_client.models.login_error import LoginError + from ibutsu_client.models.login_support import LoginSupport + from ibutsu_client.models.login_token import LoginToken + from ibutsu_client.models.model_import import ModelImport + from ibutsu_client.models.pagination import Pagination + from ibutsu_client.models.project import Project + from ibutsu_client.models.project_list import ProjectList + from ibutsu_client.models.report import Report + from ibutsu_client.models.report_list import ReportList + from ibutsu_client.models.report_parameters import ReportParameters + from ibutsu_client.models.result import Result + from ibutsu_client.models.result_list import ResultList + from ibutsu_client.models.run import Run + from ibutsu_client.models.run_list import RunList + from ibutsu_client.models.token import Token + from ibutsu_client.models.token_list import TokenList + from ibutsu_client.models.update_run import UpdateRun + from ibutsu_client.models.user import User + from ibutsu_client.models.user_list import UserList + from ibutsu_client.models.widget_config import WidgetConfig + from ibutsu_client.models.widget_config_list import WidgetConfigList + from ibutsu_client.models.widget_param import WidgetParam + from ibutsu_client.models.widget_type import WidgetType + from ibutsu_client.models.widget_type_list import WidgetTypeList + +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + """# import models into model package +from ibutsu_client.models.account_recovery import AccountRecovery +from ibutsu_client.models.account_registration import AccountRegistration +from ibutsu_client.models.account_reset import AccountReset +from ibutsu_client.models.artifact import Artifact +from ibutsu_client.models.artifact_list import ArtifactList +from ibutsu_client.models.create_token import CreateToken +from ibutsu_client.models.credentials import Credentials +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.models.dashboard_list import DashboardList +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner +from ibutsu_client.models.group import Group +from ibutsu_client.models.group_list import GroupList +from ibutsu_client.models.health import Health +from ibutsu_client.models.health_info import HealthInfo +from ibutsu_client.models.login_config import LoginConfig +from ibutsu_client.models.login_error import LoginError +from ibutsu_client.models.login_support import LoginSupport +from ibutsu_client.models.login_token import LoginToken +from ibutsu_client.models.model_import import ModelImport +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.project import Project +from ibutsu_client.models.project_list import ProjectList +from ibutsu_client.models.report import Report +from ibutsu_client.models.report_list import ReportList +from ibutsu_client.models.report_parameters import ReportParameters +from ibutsu_client.models.result import Result +from ibutsu_client.models.result_list import ResultList +from ibutsu_client.models.run import Run +from ibutsu_client.models.run_list import RunList +from ibutsu_client.models.token import Token +from ibutsu_client.models.token_list import TokenList +from ibutsu_client.models.update_run import UpdateRun +from ibutsu_client.models.user import User +from ibutsu_client.models.user_list import UserList +from ibutsu_client.models.widget_config import WidgetConfig +from ibutsu_client.models.widget_config_list import WidgetConfigList +from ibutsu_client.models.widget_param import WidgetParam +from ibutsu_client.models.widget_type import WidgetType +from ibutsu_client.models.widget_type_list import WidgetTypeList + +""", + name=__name__, + doc=__doc__, + ) + ) diff --git a/ibutsu_client/models/account_recovery.py b/ibutsu_client/models/account_recovery.py new file mode 100644 index 0000000..f81c60c --- /dev/null +++ b/ibutsu_client/models/account_recovery.py @@ -0,0 +1,79 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class AccountRecovery(BaseModel): + """ + AccountRecovery + """ + + email: StrictStr = Field(description="The user's e-mail address") + __properties: ClassVar[list[str]] = ["email"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of AccountRecovery from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of AccountRecovery from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"email": obj.get("email")}) + return _obj diff --git a/ibutsu_client/models/account_registration.py b/ibutsu_client/models/account_registration.py new file mode 100644 index 0000000..343006a --- /dev/null +++ b/ibutsu_client/models/account_registration.py @@ -0,0 +1,80 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class AccountRegistration(BaseModel): + """ + AccountRegistration + """ + + email: StrictStr = Field(description="The user's e-mail address") + password: StrictStr = Field(description="The user's password") + __properties: ClassVar[list[str]] = ["email", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of AccountRegistration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of AccountRegistration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"email": obj.get("email"), "password": obj.get("password")}) + return _obj diff --git a/ibutsu_client/models/account_reset.py b/ibutsu_client/models/account_reset.py new file mode 100644 index 0000000..96495c5 --- /dev/null +++ b/ibutsu_client/models/account_reset.py @@ -0,0 +1,82 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class AccountReset(BaseModel): + """ + AccountReset + """ + + activation_code: StrictStr = Field(description="The activation code generated by Ibutsu") + password: StrictStr = Field(description="The user's password") + __properties: ClassVar[list[str]] = ["activation_code", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of AccountReset from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of AccountReset from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"activation_code": obj.get("activation_code"), "password": obj.get("password")} + ) + return _obj diff --git a/ibutsu_client/models/artifact.py b/ibutsu_client/models/artifact.py new file mode 100644 index 0000000..9920ab1 --- /dev/null +++ b/ibutsu_client/models/artifact.py @@ -0,0 +1,107 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Artifact(BaseModel): + """ + Artifact + """ + + id: UUID | None = Field(default=None, description="Unique ID of the artifact") + result_id: UUID | None = Field( + default=None, description="ID of test result to attach artifact to" + ) + run_id: UUID | None = Field(default=None, description="ID of test run to attach artifact to") + filename: StrictStr | None = Field(default=None, description="name of the file") + additional_metadata: dict[str, Any] | None = Field( + default=None, description="Additional data to pass to server" + ) + upload_date: StrictStr | None = Field( + default=None, description="The date this artifact was uploaded" + ) + __properties: ClassVar[list[str]] = [ + "id", + "result_id", + "run_id", + "filename", + "additional_metadata", + "upload_date", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Artifact from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Artifact from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "result_id": obj.get("result_id"), + "run_id": obj.get("run_id"), + "filename": obj.get("filename"), + "additional_metadata": obj.get("additional_metadata"), + "upload_date": obj.get("upload_date"), + } + ) + return _obj diff --git a/ibutsu_client/models/artifact_list.py b/ibutsu_client/models/artifact_list.py new file mode 100644 index 0000000..d213a9d --- /dev/null +++ b/ibutsu_client/models/artifact_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.artifact import Artifact +from ibutsu_client.models.pagination import Pagination + + +class ArtifactList(BaseModel): + """ + ArtifactList + """ + + artifacts: list[Artifact] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["artifacts", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ArtifactList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in artifacts (list) + _items = [] + if self.artifacts: + for _item_artifacts in self.artifacts: + if _item_artifacts: + _items.append(_item_artifacts.to_dict()) + _dict["artifacts"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ArtifactList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "artifacts": [Artifact.from_dict(_item) for _item in obj["artifacts"]] + if obj.get("artifacts") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/create_token.py b/ibutsu_client/models/create_token.py new file mode 100644 index 0000000..8f092dc --- /dev/null +++ b/ibutsu_client/models/create_token.py @@ -0,0 +1,85 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class CreateToken(BaseModel): + """ + CreateToken + """ + + name: StrictStr = Field(description="The name given to this token") + expires: StrictStr | None = Field(description="The date and time when this token expires") + __properties: ClassVar[list[str]] = ["name", "expires"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of CreateToken from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if expires (nullable) is None + # and model_fields_set contains the field + if self.expires is None and "expires" in self.model_fields_set: + _dict["expires"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of CreateToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"name": obj.get("name"), "expires": obj.get("expires")}) + return _obj diff --git a/ibutsu_client/models/credentials.py b/ibutsu_client/models/credentials.py new file mode 100644 index 0000000..450419e --- /dev/null +++ b/ibutsu_client/models/credentials.py @@ -0,0 +1,80 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Credentials(BaseModel): + """ + Credentials + """ + + email: StrictStr = Field(description="The e-mail address of the user") + password: StrictStr = Field(description="The password for the user") + __properties: ClassVar[list[str]] = ["email", "password"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Credentials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Credentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"email": obj.get("email"), "password": obj.get("password")}) + return _obj diff --git a/ibutsu_client/models/dashboard.py b/ibutsu_client/models/dashboard.py new file mode 100644 index 0000000..98afaf0 --- /dev/null +++ b/ibutsu_client/models/dashboard.py @@ -0,0 +1,107 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Dashboard(BaseModel): + """ + Dashboard + """ + + id: UUID | None = Field(default=None, description="Unique ID of the dashboard") + title: StrictStr | None = Field(default=None, description="The title of the dashboard") + description: StrictStr | None = Field( + default=None, description="A basic description of the dashboard" + ) + filters: StrictStr | None = Field(default=None, description="An optional set of filters") + project_id: UUID | None = Field( + default=None, description="The ID of the project this dashboard is associated with" + ) + user_id: UUID | None = Field( + default=None, description="The ID of a user this dashboard might be associated with" + ) + __properties: ClassVar[list[str]] = [ + "id", + "title", + "description", + "filters", + "project_id", + "user_id", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Dashboard from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Dashboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "title": obj.get("title"), + "description": obj.get("description"), + "filters": obj.get("filters"), + "project_id": obj.get("project_id"), + "user_id": obj.get("user_id"), + } + ) + return _obj diff --git a/ibutsu_client/models/dashboard_list.py b/ibutsu_client/models/dashboard_list.py new file mode 100644 index 0000000..f2d84b0 --- /dev/null +++ b/ibutsu_client/models/dashboard_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.dashboard import Dashboard +from ibutsu_client.models.pagination import Pagination + + +class DashboardList(BaseModel): + """ + DashboardList + """ + + dashboards: list[Dashboard] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["dashboards", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of DashboardList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in dashboards (list) + _items = [] + if self.dashboards: + for _item_dashboards in self.dashboards: + if _item_dashboards: + _items.append(_item_dashboards.to_dict()) + _dict["dashboards"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of DashboardList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "dashboards": [Dashboard.from_dict(_item) for _item in obj["dashboards"]] + if obj.get("dashboards") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/get_report_types200_response_inner.py b/ibutsu_client/models/get_report_types200_response_inner.py new file mode 100644 index 0000000..732adf4 --- /dev/null +++ b/ibutsu_client/models/get_report_types200_response_inner.py @@ -0,0 +1,84 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class GetReportTypes200ResponseInner(BaseModel): + """ + GetReportTypes200ResponseInner + """ + + type: StrictStr | None = Field( + default=None, description="The machine-readable name of report type" + ) + name: StrictStr | None = Field( + default=None, description="The human-readable name of report type" + ) + __properties: ClassVar[list[str]] = ["type", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of GetReportTypes200ResponseInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of GetReportTypes200ResponseInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"type": obj.get("type"), "name": obj.get("name")}) + return _obj diff --git a/ibutsu_client/models/group.py b/ibutsu_client/models/group.py new file mode 100644 index 0000000..b38c33f --- /dev/null +++ b/ibutsu_client/models/group.py @@ -0,0 +1,81 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Group(BaseModel): + """ + Group + """ + + id: UUID | None = Field(default=None, description="Unique ID of the group") + name: StrictStr | None = Field(default=None, description="The name of the group") + __properties: ClassVar[list[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Group from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Group from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")}) + return _obj diff --git a/ibutsu_client/models/group_list.py b/ibutsu_client/models/group_list.py new file mode 100644 index 0000000..3d9ddb8 --- /dev/null +++ b/ibutsu_client/models/group_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.group import Group +from ibutsu_client.models.pagination import Pagination + + +class GroupList(BaseModel): + """ + GroupList + """ + + groups: list[Group] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["groups", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of GroupList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in groups (list) + _items = [] + if self.groups: + for _item_groups in self.groups: + if _item_groups: + _items.append(_item_groups.to_dict()) + _dict["groups"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of GroupList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "groups": [Group.from_dict(_item) for _item in obj["groups"]] + if obj.get("groups") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/health.py b/ibutsu_client/models/health.py new file mode 100644 index 0000000..0629265 --- /dev/null +++ b/ibutsu_client/models/health.py @@ -0,0 +1,84 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Health(BaseModel): + """ + Health + """ + + status: StrictStr | None = Field( + default=None, description='The status of the database, one of "OK", "Error", "Pending"' + ) + message: StrictStr | None = Field( + default=None, description="A message to explain the current status" + ) + __properties: ClassVar[list[str]] = ["status", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Health from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Health from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"status": obj.get("status"), "message": obj.get("message")}) + return _obj diff --git a/ibutsu_client/models/health_info.py b/ibutsu_client/models/health_info.py new file mode 100644 index 0000000..4f5c190 --- /dev/null +++ b/ibutsu_client/models/health_info.py @@ -0,0 +1,87 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class HealthInfo(BaseModel): + """ + HealthInfo + """ + + frontend: StrictStr | None = Field(default=None, description="The URL of the frontend") + backend: StrictStr | None = Field(default=None, description="The URL of the backend") + api_ui: StrictStr | None = Field(default=None, description="The URL to the UI for the API") + __properties: ClassVar[list[str]] = ["frontend", "backend", "api_ui"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of HealthInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of HealthInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "frontend": obj.get("frontend"), + "backend": obj.get("backend"), + "api_ui": obj.get("api_ui"), + } + ) + return _obj diff --git a/ibutsu_client/models/login_config.py b/ibutsu_client/models/login_config.py new file mode 100644 index 0000000..8c2a687 --- /dev/null +++ b/ibutsu_client/models/login_config.py @@ -0,0 +1,89 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class LoginConfig(BaseModel): + """ + LoginConfig + """ + + client_id: StrictStr | None = Field(default=None, description="The client ID for the provider") + redirect_uri: StrictStr | None = Field( + default=None, description="The redirect URI for the provider to call back" + ) + scope: StrictStr | None = Field(default=None, description="The OAuth2 permission scope") + __properties: ClassVar[list[str]] = ["client_id", "redirect_uri", "scope"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of LoginConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of LoginConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "client_id": obj.get("client_id"), + "redirect_uri": obj.get("redirect_uri"), + "scope": obj.get("scope"), + } + ) + return _obj diff --git a/ibutsu_client/models/login_error.py b/ibutsu_client/models/login_error.py new file mode 100644 index 0000000..39bbf5f --- /dev/null +++ b/ibutsu_client/models/login_error.py @@ -0,0 +1,84 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class LoginError(BaseModel): + """ + LoginError + """ + + code: StrictStr | None = Field( + default=None, description="An error code generated by the server" + ) + message: StrictStr | None = Field( + default=None, description="The error message that corresponds with the error code" + ) + __properties: ClassVar[list[str]] = ["code", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of LoginError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of LoginError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"code": obj.get("code"), "message": obj.get("message")}) + return _obj diff --git a/ibutsu_client/models/login_support.py b/ibutsu_client/models/login_support.py new file mode 100644 index 0000000..e1bf0c0 --- /dev/null +++ b/ibutsu_client/models/login_support.py @@ -0,0 +1,112 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictBool + + +class LoginSupport(BaseModel): + """ + LoginSupport + """ + + user: StrictBool | None = Field( + default=None, description="Flag to see if email/password login is available" + ) + keycloak: StrictBool | None = Field( + default=None, description="Flag to see if Keycloak login is available" + ) + google: StrictBool | None = Field( + default=None, description="Flag to see if Google login is available" + ) + github: StrictBool | None = Field( + default=None, description="Flag to see if GitHub login is available" + ) + facebook: StrictBool | None = Field( + default=None, description="Flag to see if Facebook login is available" + ) + gitlab: StrictBool | None = Field( + default=None, description="Flag to see if GitLab login is available" + ) + __properties: ClassVar[list[str]] = [ + "user", + "keycloak", + "google", + "github", + "facebook", + "gitlab", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of LoginSupport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of LoginSupport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "user": obj.get("user"), + "keycloak": obj.get("keycloak"), + "google": obj.get("google"), + "github": obj.get("github"), + "facebook": obj.get("facebook"), + "gitlab": obj.get("gitlab"), + } + ) + return _obj diff --git a/ibutsu_client/models/login_token.py b/ibutsu_client/models/login_token.py new file mode 100644 index 0000000..c1884df --- /dev/null +++ b/ibutsu_client/models/login_token.py @@ -0,0 +1,81 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class LoginToken(BaseModel): + """ + LoginToken + """ + + token: StrictStr | None = Field( + default=None, description="The JWT token returned from a successful login" + ) + __properties: ClassVar[list[str]] = ["token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of LoginToken from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of LoginToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"token": obj.get("token")}) + return _obj diff --git a/ibutsu_client/models/model_import.py b/ibutsu_client/models/model_import.py new file mode 100644 index 0000000..8a9cbf0 --- /dev/null +++ b/ibutsu_client/models/model_import.py @@ -0,0 +1,97 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class ModelImport(BaseModel): + """ + ModelImport + """ + + id: UUID | None = Field(default=None, description="The database ID of the import") + status: StrictStr | None = Field( + default=None, + description='The current status of the import, can be one of "pending", "running", "done"', + ) + filename: StrictStr | None = Field( + default=None, description="The name of the file that was uploaded" + ) + format: StrictStr | None = Field(default=None, description="The format of the file uploaded") + run_id: UUID | None = Field(default=None, description="The ID of the run from the import") + __properties: ClassVar[list[str]] = ["id", "status", "filename", "format", "run_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelImport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelImport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "status": obj.get("status"), + "filename": obj.get("filename"), + "format": obj.get("format"), + "run_id": obj.get("run_id"), + } + ) + return _obj diff --git a/ibutsu_client/models/pagination.py b/ibutsu_client/models/pagination.py new file mode 100644 index 0000000..abd1f57 --- /dev/null +++ b/ibutsu_client/models/pagination.py @@ -0,0 +1,95 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictInt + + +class Pagination(BaseModel): + """ + Pagination + """ + + page: StrictInt | None = Field(default=None, description="The current page number") + page_size: StrictInt | None = Field( + default=None, description="The number of items per page", alias="pageSize" + ) + total_pages: StrictInt | None = Field( + default=None, description="The total number of pages", alias="totalPages" + ) + total_items: StrictInt | None = Field( + default=None, description="The total number of items for this query", alias="totalItems" + ) + __properties: ClassVar[list[str]] = ["page", "pageSize", "totalPages", "totalItems"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Pagination from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Pagination from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "page": obj.get("page"), + "pageSize": obj.get("pageSize"), + "totalPages": obj.get("totalPages"), + "totalItems": obj.get("totalItems"), + } + ) + return _obj diff --git a/ibutsu_client/models/project.py b/ibutsu_client/models/project.py new file mode 100644 index 0000000..351cb57 --- /dev/null +++ b/ibutsu_client/models/project.py @@ -0,0 +1,104 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Project(BaseModel): + """ + Project + """ + + id: UUID | None = Field(default=None, description="Unique ID of the project") + name: StrictStr | None = Field(default=None, description="The machine name of the project") + title: StrictStr | None = Field( + default=None, description="The human-readable title of the project" + ) + owner_id: UUID | None = Field(default=None, description="The ID of the owner of this project") + group_id: UUID | None = Field(default=None, description="The ID of the group of this project") + __properties: ClassVar[list[str]] = ["id", "name", "title", "owner_id", "group_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Project from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if owner_id (nullable) is None + # and model_fields_set contains the field + if self.owner_id is None and "owner_id" in self.model_fields_set: + _dict["owner_id"] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict["group_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Project from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "name": obj.get("name"), + "title": obj.get("title"), + "owner_id": obj.get("owner_id"), + "group_id": obj.get("group_id"), + } + ) + return _obj diff --git a/ibutsu_client/models/project_list.py b/ibutsu_client/models/project_list.py new file mode 100644 index 0000000..f35080a --- /dev/null +++ b/ibutsu_client/models/project_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.project import Project + + +class ProjectList(BaseModel): + """ + ProjectList + """ + + projects: list[Project] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["projects", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ProjectList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in projects (list) + _items = [] + if self.projects: + for _item_projects in self.projects: + if _item_projects: + _items.append(_item_projects.to_dict()) + _dict["projects"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ProjectList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "projects": [Project.from_dict(_item) for _item in obj["projects"]] + if obj.get("projects") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/report.py b/ibutsu_client/models/report.py new file mode 100644 index 0000000..565cc38 --- /dev/null +++ b/ibutsu_client/models/report.py @@ -0,0 +1,122 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + +from ibutsu_client.models.report_parameters import ReportParameters + + +class Report(BaseModel): + """ + Report + """ + + id: UUID | None = Field(default=None, description="Unique ID of the report") + filename: StrictStr | None = Field(default=None, description="The filename of the report") + mimetype: StrictStr | None = Field( + default=None, description="The mime type of the downloadable file" + ) + url: StrictStr | None = Field( + default=None, description="The URL to the downloadable report (deprecated)" + ) + download_url: StrictStr | None = Field( + default=None, description="The URL to the downloadable report" + ) + view_url: StrictStr | None = Field(default=None, description="The URL to the viewable report") + parameters: ReportParameters | None = None + status: StrictStr | None = Field( + default=None, description='The status of the report, one of "pending", "running", "done"' + ) + __properties: ClassVar[list[str]] = [ + "id", + "filename", + "mimetype", + "url", + "download_url", + "view_url", + "parameters", + "status", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Report from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of parameters + if self.parameters: + _dict["parameters"] = self.parameters.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Report from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "filename": obj.get("filename"), + "mimetype": obj.get("mimetype"), + "url": obj.get("url"), + "download_url": obj.get("download_url"), + "view_url": obj.get("view_url"), + "parameters": ReportParameters.from_dict(obj["parameters"]) + if obj.get("parameters") is not None + else None, + "status": obj.get("status"), + } + ) + return _obj diff --git a/ibutsu_client/models/report_list.py b/ibutsu_client/models/report_list.py new file mode 100644 index 0000000..dd7449a --- /dev/null +++ b/ibutsu_client/models/report_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.report import Report + + +class ReportList(BaseModel): + """ + ReportList + """ + + reports: list[Report] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["reports", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ReportList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in reports (list) + _items = [] + if self.reports: + for _item_reports in self.reports: + if _item_reports: + _items.append(_item_reports.to_dict()) + _dict["reports"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ReportList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "reports": [Report.from_dict(_item) for _item in obj["reports"]] + if obj.get("reports") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/report_parameters.py b/ibutsu_client/models/report_parameters.py new file mode 100644 index 0000000..a578ad7 --- /dev/null +++ b/ibutsu_client/models/report_parameters.py @@ -0,0 +1,85 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class ReportParameters(BaseModel): + """ + ReportParameters + """ + + type: StrictStr = Field(description="The type of report to generate") + filter: StrictStr | None = Field( + default=None, description="A regular expression to filter test results by" + ) + source: StrictStr | None = Field(default=None, description="The source of the test results") + __properties: ClassVar[list[str]] = ["type", "filter", "source"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ReportParameters from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ReportParameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"type": obj.get("type"), "filter": obj.get("filter"), "source": obj.get("source")} + ) + return _obj diff --git a/ibutsu_client/models/result.py b/ibutsu_client/models/result.py new file mode 100644 index 0000000..d146688 --- /dev/null +++ b/ibutsu_client/models/result.py @@ -0,0 +1,177 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) + + +class Result(BaseModel): + """ + Result + """ + + id: UUID | None = Field(default=None, description="Unique ID of the test result") + test_id: StrictStr | None = Field(default=None, description="Unique id") + start_time: StrictStr | None = Field(default=None, description="Timestamp of starttime.") + duration: StrictFloat | StrictInt | None = Field( + default=None, description="Duration of test in seconds." + ) + result: StrictStr | None = Field(default=None, description="Status of result.") + component: StrictStr | None = Field(default=None, description="A component") + env: StrictStr | None = Field( + default=None, description="The environment which is being tested" + ) + run_id: UUID | None = Field(default=None, description="The run this result is associated with") + project_id: UUID | None = Field( + default=None, description="The project this run is associated with" + ) + metadata: dict[str, Any] | None = None + params: dict[str, Any] | None = None + source: StrictStr | None = Field( + default=None, description="Where the data came from (useful for filtering)" + ) + __properties: ClassVar[list[str]] = [ + "id", + "test_id", + "start_time", + "duration", + "result", + "component", + "env", + "run_id", + "project_id", + "metadata", + "params", + "source", + ] + + @field_validator("result") + @classmethod + def result_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in { + "passed", + "failed", + "error", + "skipped", + "xpassed", + "xfailed", + "manual", + "blocked", + }: + raise ValueError( + "must be one of enum values ('passed', 'failed', 'error', 'skipped', 'xpassed', 'xfailed', 'manual', 'blocked')" + ) + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Result from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if component (nullable) is None + # and model_fields_set contains the field + if self.component is None and "component" in self.model_fields_set: + _dict["component"] = None + + # set to None if env (nullable) is None + # and model_fields_set contains the field + if self.env is None and "env" in self.model_fields_set: + _dict["env"] = None + + # set to None if run_id (nullable) is None + # and model_fields_set contains the field + if self.run_id is None and "run_id" in self.model_fields_set: + _dict["run_id"] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict["project_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Result from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "test_id": obj.get("test_id"), + "start_time": obj.get("start_time"), + "duration": obj.get("duration"), + "result": obj.get("result"), + "component": obj.get("component"), + "env": obj.get("env"), + "run_id": obj.get("run_id"), + "project_id": obj.get("project_id"), + "metadata": obj.get("metadata"), + "params": obj.get("params"), + "source": obj.get("source"), + } + ) + return _obj diff --git a/ibutsu_client/models/result_list.py b/ibutsu_client/models/result_list.py new file mode 100644 index 0000000..4e55783 --- /dev/null +++ b/ibutsu_client/models/result_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.result import Result + + +class ResultList(BaseModel): + """ + ResultList + """ + + results: list[Result] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["results", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ResultList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict["results"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ResultList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "results": [Result.from_dict(_item) for _item in obj["results"]] + if obj.get("results") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/run.py b/ibutsu_client/models/run.py new file mode 100644 index 0000000..0c8fc5e --- /dev/null +++ b/ibutsu_client/models/run.py @@ -0,0 +1,148 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr + + +class Run(BaseModel): + """ + Run + """ + + id: UUID | None = Field(default=None, description="Unique ID of the test run") + created: StrictStr | None = Field(default=None, description="The time this record was created") + duration: StrictFloat | StrictInt | None = Field( + default=None, description="Duration of tests in seconds" + ) + source: StrictStr | None = Field(default=None, description="A source for this test run") + start_time: StrictStr | None = Field(default=None, description="The time the test run started") + component: StrictStr | None = Field(default=None, description="A component") + env: StrictStr | None = Field( + default=None, description="The environment which is being tested" + ) + project_id: UUID | None = Field( + default=None, description="The project this run is associated with" + ) + summary: dict[str, Any] | None = Field( + default=None, description="A summary of the test results" + ) + metadata: dict[str, Any] | None = Field( + default=None, description="Extra metadata for this run" + ) + __properties: ClassVar[list[str]] = [ + "id", + "created", + "duration", + "source", + "start_time", + "component", + "env", + "project_id", + "summary", + "metadata", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Run from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if source (nullable) is None + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: + _dict["source"] = None + + # set to None if component (nullable) is None + # and model_fields_set contains the field + if self.component is None and "component" in self.model_fields_set: + _dict["component"] = None + + # set to None if env (nullable) is None + # and model_fields_set contains the field + if self.env is None and "env" in self.model_fields_set: + _dict["env"] = None + + # set to None if project_id (nullable) is None + # and model_fields_set contains the field + if self.project_id is None and "project_id" in self.model_fields_set: + _dict["project_id"] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict["metadata"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Run from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "created": obj.get("created"), + "duration": obj.get("duration"), + "source": obj.get("source"), + "start_time": obj.get("start_time"), + "component": obj.get("component"), + "env": obj.get("env"), + "project_id": obj.get("project_id"), + "summary": obj.get("summary"), + "metadata": obj.get("metadata"), + } + ) + return _obj diff --git a/ibutsu_client/models/run_list.py b/ibutsu_client/models/run_list.py new file mode 100644 index 0000000..bf2830d --- /dev/null +++ b/ibutsu_client/models/run_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.run import Run + + +class RunList(BaseModel): + """ + RunList + """ + + runs: list[Run] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["runs", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of RunList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in runs (list) + _items = [] + if self.runs: + for _item_runs in self.runs: + if _item_runs: + _items.append(_item_runs.to_dict()) + _dict["runs"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of RunList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "runs": [Run.from_dict(_item) for _item in obj["runs"]] + if obj.get("runs") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/token.py b/ibutsu_client/models/token.py new file mode 100644 index 0000000..55b2579 --- /dev/null +++ b/ibutsu_client/models/token.py @@ -0,0 +1,99 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class Token(BaseModel): + """ + Token + """ + + id: UUID = Field(description="The ID of the token") + user_id: UUID = Field(description="The ID of the user that owns this token") + name: StrictStr = Field(description="The name given to this token") + expires: StrictStr | None = Field( + default=None, description="The date and time when this token expires" + ) + token: StrictStr = Field(description="The token itself") + __properties: ClassVar[list[str]] = ["id", "user_id", "name", "expires", "token"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Token from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if expires (nullable) is None + # and model_fields_set contains the field + if self.expires is None and "expires" in self.model_fields_set: + _dict["expires"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Token from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "user_id": obj.get("user_id"), + "name": obj.get("name"), + "expires": obj.get("expires"), + "token": obj.get("token"), + } + ) + return _obj diff --git a/ibutsu_client/models/token_list.py b/ibutsu_client/models/token_list.py new file mode 100644 index 0000000..36b7203 --- /dev/null +++ b/ibutsu_client/models/token_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.token import Token + + +class TokenList(BaseModel): + """ + TokenList + """ + + tokens: list[Token] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["tokens", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of TokenList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tokens (list) + _items = [] + if self.tokens: + for _item_tokens in self.tokens: + if _item_tokens: + _items.append(_item_tokens.to_dict()) + _dict["tokens"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of TokenList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "tokens": [Token.from_dict(_item) for _item in obj["tokens"]] + if obj.get("tokens") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/update_run.py b/ibutsu_client/models/update_run.py new file mode 100644 index 0000000..2d447aa --- /dev/null +++ b/ibutsu_client/models/update_run.py @@ -0,0 +1,79 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field + + +class UpdateRun(BaseModel): + """ + UpdateRun + """ + + metadata: dict[str, Any] | None = Field(default=None, description="Extra data for this run") + __properties: ClassVar[list[str]] = ["metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of UpdateRun from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of UpdateRun from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"metadata": obj.get("metadata")}) + return _obj diff --git a/ibutsu_client/models/user.py b/ibutsu_client/models/user.py new file mode 100644 index 0000000..fc9c07c --- /dev/null +++ b/ibutsu_client/models/user.py @@ -0,0 +1,115 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr + + +class User(BaseModel): + """ + User + """ + + id: UUID | None = Field(default=None, description="The ID of the user") + email: StrictStr = Field(description="The user's e-mail address") + name: StrictStr | None = Field(default=None, description="The user's name") + is_superadmin: StrictBool | None = Field( + default=None, description="Flag to show if a user is a super-admin" + ) + is_active: StrictBool | None = Field( + default=None, description="Flag to show if the user is active" + ) + group_id: UUID | None = Field(default=None, description="The ID of the group of this project") + __properties: ClassVar[list[str]] = [ + "id", + "email", + "name", + "is_superadmin", + "is_active", + "group_id", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of User from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict["name"] = None + + # set to None if group_id (nullable) is None + # and model_fields_set contains the field + if self.group_id is None and "group_id" in self.model_fields_set: + _dict["group_id"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of User from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "email": obj.get("email"), + "name": obj.get("name"), + "is_superadmin": obj.get("is_superadmin"), + "is_active": obj.get("is_active"), + "group_id": obj.get("group_id"), + } + ) + return _obj diff --git a/ibutsu_client/models/user_list.py b/ibutsu_client/models/user_list.py new file mode 100644 index 0000000..679b4d8 --- /dev/null +++ b/ibutsu_client/models/user_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.user import User + + +class UserList(BaseModel): + """ + UserList + """ + + users: list[User] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["users", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of UserList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in users (list) + _items = [] + if self.users: + for _item_users in self.users: + if _item_users: + _items.append(_item_users.to_dict()) + _dict["users"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of UserList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "users": [User.from_dict(_item) for _item in obj["users"]] + if obj.get("users") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/widget_config.py b/ibutsu_client/models/widget_config.py new file mode 100644 index 0000000..9b6b77e --- /dev/null +++ b/ibutsu_client/models/widget_config.py @@ -0,0 +1,117 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self +from uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr + + +class WidgetConfig(BaseModel): + """ + WidgetConfig + """ + + id: UUID | None = Field(default=None, description="The internal ID of the WidgetConfig") + type: StrictStr | None = Field( + default=None, description='The type of widget, one of either "widget" or "view"' + ) + widget: StrictStr | None = Field( + default=None, description="The widget to render, from the list at /widget/types" + ) + project_id: UUID | None = Field( + default=None, description="The project ID for which the widget is designed" + ) + weight: StrictInt | None = Field( + default=None, + description="The weighting for the widget, lower weight means it will display first", + ) + params: dict[str, Any] | None = Field( + default=None, description="A dictionary of parameters to send to the widget" + ) + title: StrictStr | None = Field( + default=None, description="The title shown on the widget or page" + ) + __properties: ClassVar[list[str]] = [ + "id", + "type", + "widget", + "project_id", + "weight", + "params", + "title", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of WidgetConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of WidgetConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "type": obj.get("type"), + "widget": obj.get("widget"), + "project_id": obj.get("project_id"), + "weight": obj.get("weight"), + "params": obj.get("params"), + "title": obj.get("title"), + } + ) + return _obj diff --git a/ibutsu_client/models/widget_config_list.py b/ibutsu_client/models/widget_config_list.py new file mode 100644 index 0000000..5133563 --- /dev/null +++ b/ibutsu_client/models/widget_config_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.widget_config import WidgetConfig + + +class WidgetConfigList(BaseModel): + """ + WidgetConfigList + """ + + widgets: list[WidgetConfig] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["widgets", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of WidgetConfigList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in widgets (list) + _items = [] + if self.widgets: + for _item_widgets in self.widgets: + if _item_widgets: + _items.append(_item_widgets.to_dict()) + _dict["widgets"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of WidgetConfigList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "widgets": [WidgetConfig.from_dict(_item) for _item in obj["widgets"]] + if obj.get("widgets") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/models/widget_param.py b/ibutsu_client/models/widget_param.py new file mode 100644 index 0000000..93b0f9d --- /dev/null +++ b/ibutsu_client/models/widget_param.py @@ -0,0 +1,93 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + + +class WidgetParam(BaseModel): + """ + WidgetParam + """ + + name: StrictStr | None = Field( + default=None, description="The name of the parameter to supply to the widget" + ) + description: StrictStr | None = Field( + default=None, description="A friendly description of the parameter" + ) + type: StrictStr | None = Field( + default=None, description="The type of parameter (string, integer, etc)" + ) + __properties: ClassVar[list[str]] = ["name", "description", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of WidgetParam from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of WidgetParam from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "description": obj.get("description"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/ibutsu_client/models/widget_type.py b/ibutsu_client/models/widget_type.py new file mode 100644 index 0000000..29d9fa8 --- /dev/null +++ b/ibutsu_client/models/widget_type.py @@ -0,0 +1,110 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict, Field, StrictStr + +from ibutsu_client.models.widget_param import WidgetParam + + +class WidgetType(BaseModel): + """ + WidgetType + """ + + id: StrictStr | None = Field( + default=None, description="A unique identifier for this widget type" + ) + title: StrictStr | None = Field( + default=None, description="The title of the widget, for users to see" + ) + description: StrictStr | None = Field( + default=None, description="A helpful description of this widget type" + ) + params: list[WidgetParam] | None = Field( + default=None, description="A dictionary or map of parameters to values" + ) + type: StrictStr | None = Field(default=None, description="The type of widget (widget, view)") + __properties: ClassVar[list[str]] = ["id", "title", "description", "params", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of WidgetType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in params (list) + _items = [] + if self.params: + for _item_params in self.params: + if _item_params: + _items.append(_item_params.to_dict()) + _dict["params"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of WidgetType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "title": obj.get("title"), + "description": obj.get("description"), + "params": [WidgetParam.from_dict(_item) for _item in obj["params"]] + if obj.get("params") is not None + else None, + "type": obj.get("type"), + } + ) + return _obj diff --git a/ibutsu_client/models/widget_type_list.py b/ibutsu_client/models/widget_type_list.py new file mode 100644 index 0000000..6188410 --- /dev/null +++ b/ibutsu_client/models/widget_type_list.py @@ -0,0 +1,102 @@ +""" +Ibutsu API + +A system to store and query test results + +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Self + +from pydantic import BaseModel, ConfigDict + +from ibutsu_client.models.pagination import Pagination +from ibutsu_client.models.widget_type import WidgetType + + +class WidgetTypeList(BaseModel): + """ + WidgetTypeList + """ + + types: list[WidgetType] | None = None + pagination: Pagination | None = None + __properties: ClassVar[list[str]] = ["types", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of WidgetTypeList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in types (list) + _items = [] + if self.types: + for _item_types in self.types: + if _item_types: + _items.append(_item_types.to_dict()) + _dict["types"] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict["pagination"] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of WidgetTypeList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "types": [WidgetType.from_dict(_item) for _item in obj["types"]] + if obj.get("types") is not None + else None, + "pagination": Pagination.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None, + } + ) + return _obj diff --git a/ibutsu_client/py.typed b/ibutsu_client/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/ibutsu_client/rest.py b/ibutsu_client/rest.py index c17967a..95829a6 100644 --- a/ibutsu_client/rest.py +++ b/ibutsu_client/rest.py @@ -3,55 +3,61 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import io -import ipaddress import json -import logging import re import ssl -from urllib.parse import urlencode, urlparse -from urllib.request import proxy_bypass_environment import urllib3 -from ibutsu_client.exceptions import ( - ApiException, - ApiValueError, - ForbiddenException, - NotFoundException, - ServiceException, - UnauthorizedException, -) +from ibutsu_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 - # maxsize is the number of requests to host that are allowed in parallel # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # cert_reqs @@ -60,72 +66,57 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } if configuration.assert_hostname is not None: - addition_pool_args["assert_hostname"] = configuration.assert_hostname + pool_args["assert_hostname"] = configuration.assert_hostname if configuration.retries is not None: - addition_pool_args["retries"] = configuration.retries + pool_args["retries"] = configuration.retries + + if configuration.tls_server_name: + pool_args["server_hostname"] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args["socket_options"] = configuration.socket_options + pool_args["socket_options"] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args["maxsize"] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or "" - ): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args, - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args, - ) + self.pool_manager = urllib3.PoolManager(**pool_args) def request( - self, - method, - url, - query_params=None, - headers=None, - body=None, - post_params=None, - _preload_content=True, - _request_timeout=None, + self, method, url, headers=None, body=None, post_params=None, _request_timeout=None ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -150,14 +141,9 @@ def request( try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != "DELETE") and ("Content-Type" not in headers): - headers["Content-Type"] = "application/json" - if query_params: - url += "?" + urlencode(query_params) - if ("Content-Type" not in headers) or ( - re.search("json", headers["Content-Type"], re.IGNORECASE) - ): + # no content type provided or payload is json + content_type = headers.get("Content-Type") + if not content_type or re.search("json", content_type, re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) @@ -165,44 +151,58 @@ def request( method, url, body=request_body, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) - elif headers["Content-Type"] == "application/x-www-form-urlencoded": + elif content_type == "application/x-www-form-urlencoded": r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) - elif headers["Content-Type"] == "multipart/form-data": + elif content_type == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers["Content-Type"] + # Ensures that dict objects are serialized + post_params = [ + (a, json.dumps(b)) if isinstance(b, dict) else (a, b) + for a, b in post_params + ] r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): + request_body = "true" if body else "false" r = self.pool_manager.request( method, url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers, ) @@ -215,216 +215,10 @@ def request( # For `GET`, `HEAD` else: r = self.pool_manager.request( - method, - url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers, + method, url, fields={}, timeout=timeout, headers=headers, preload_content=False ) except urllib3.exceptions.SSLError as e: - msg = f"{type(e).__name__}\n{e!s}" + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET( - self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None - ): - return self.request( - "GET", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def HEAD( - self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None - ): - return self.request( - "HEAD", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def OPTIONS( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "OPTIONS", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def DELETE( - self, - url, - headers=None, - query_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def POST( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "POST", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PUT( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PUT", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def PATCH( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PATCH", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - -# end of class RESTClientObject - - -def is_ipv4(target): - """Test if IPv4 address or not""" - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """Test if target belongs to given IPv4 network""" - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, ""]: - return True - - # special cases - if no_proxy in [None, ""]: - return False - if no_proxy == "*": - return True - - no_proxy = no_proxy.lower().replace(" ", "") - entries = (host for host in no_proxy.split(",") if host) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {"no": no_proxy}) + return RESTResponse(r) diff --git a/pyproject.toml b/pyproject.toml index 0cd87d1..64e9028 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -17,8 +14,11 @@ classifiers = [ "Topic :: Software Development :: Testing", ] dependencies = [ - "urllib3>=1.25.3", - "python-dateutil>=2.5.3", + "urllib3>=2.1.0,<3.0.0", + "python-dateutil>=2.8.2", + "pydantic>=2", + "typing-extensions>=4.7.1", + "lazy-imports>=1,<2", ] description = "A system to store and query test results" dynamic = ["version"] @@ -26,7 +26,7 @@ license = "MIT" maintainers = [{name = "OpenAPI Generator community"}, {name = "Ibutsu Team"}] name = "ibutsu-client" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.11" keywords = ["OpenAPI", "OpenAPI-Generator", "Ibutsu API", "testing", "results"] [project.urls] @@ -65,7 +65,7 @@ packages = ["/ibutsu_client"] extra-dependencies = ["ibutsu-client[test]"] [[tool.hatch.envs.hatch-test.matrix]] -python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +python = ["3.11", "3.12", "3.13"] [tool.hatch.envs.test] dependencies = [ @@ -73,6 +73,17 @@ dependencies = [ "pytest-cov", "coverage[toml]", ] +extra-dependencies = [ + "pytest-rerunfailures", + "pytest-mock", + "pytest-xdist", +] + +[tool.hatch.envs.test.scripts] +test = "pytest {args:test}" +cov = "pytest --cov=ibutsu_client {args:test}" +# Alias for the hatch test command that looks for tests/ instead of test/ +run = "pytest {args:test}" [tool.mypy] # Enable strict mode for maximum type safety @@ -159,7 +170,7 @@ output = "coverage.xml" [tool.ruff] line-length = 99 -target-version = "py38" +target-version = "py311" [tool.ruff.lint] extend-select = [ @@ -215,6 +226,8 @@ ignore = [ "RUF002", # Docstring contains ambiguous unicode characters - generated code "C409", # Unnecessary list literal passed to tuple() - generated code patterns "N818", # Exception name should be named with an Error suffix - generated code + "SIM105", # Use contextlib.suppress(Exception) instead of try-except-pass - generated code + "TCH003", # Move standard library import into type-checking block - UUID needed at runtime for Pydantic ] "setup.py" = [ "ERA001", # Found commented-out code - setup file comments diff --git a/regenerate-client.sh b/regenerate-client.sh index 9114a95..5a2585e 100755 --- a/regenerate-client.sh +++ b/regenerate-client.sh @@ -26,7 +26,7 @@ get_versions() { fi if [[ "${NEW_VERSION:-}" == "" ]]; then - # If there's no new version defined externally, generate a new version + # If there's no new version defined externally (e.g., via --target-version), generate a new version # Handle version formats like "2.3.0" or "2.3.0.d20250918" if [[ "$CURRENT_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then BASE_VERSION="${BASH_REMATCH[1]}" @@ -37,6 +37,13 @@ get_versions() { echo "Error: Unexpected version format: $CURRENT_VERSION" exit 1 fi + else + # Validate the provided target version format + if ! [[ "$NEW_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Invalid version format '$NEW_VERSION'. Expected format: X.Y.Z (e.g., 3.0.0)" + exit 1 + fi + echo "Using specified target version: $NEW_VERSION" fi } @@ -51,11 +58,12 @@ function check_dependencies() { } function print_usage() { - echo "Usage: regenerate-client.sh [-h|--help] [-v|--version] OPENAPI_FILE" + echo "Usage: regenerate-client.sh [-h|--help] [-v|--version] [--target-version VERSION] OPENAPI_FILE" echo "" echo "optional arguments:" - echo " -h, --help show this help message" - echo " -v, --version show the prospective new version number" + echo " -h, --help show this help message" + echo " -v, --version show the prospective new version number" + echo " --target-version VERSION specify a target version (e.g., 3.0.0)" echo "" echo "This script regenerates the client on the current branch and leaves" echo "uncommitted changes in the working tree after running pre-commit." @@ -85,6 +93,15 @@ while (( "$#" )); do echo "Prospective version number: $NEW_VERSION" exit 0 ;; + --target-version) + if [[ -n "$2" && "$2" != -* ]]; then + NEW_VERSION="$2" + shift 2 + else + echo "Error: --target-version requires a version number argument" >&2 + exit 1 + fi + ;; -*|--*) echo "Error: unsupported option $1" >&2 exit 1 @@ -113,7 +130,7 @@ echo "Generating client with OpenAPI Generator v${OPENAPI_GENERATOR_VERSION}..." mkdir -p "$(dirname "${TEMP_DIR}")" podman run --rm \ - -v "${CLIENT_DIR}:/local" \ + -v "${CLIENT_DIR}:/local:Z" \ "openapitools/openapi-generator-cli:v${OPENAPI_GENERATOR_VERSION}" \ generate \ -i "/local/${OPENAPI_FILE}" \ @@ -125,7 +142,7 @@ podman run --rm \ --global-property skipFormModel=true \ -p packageVersion="${NEW_VERSION}" \ -p packageUrl=https://github.com/ibutsu/ibutsu-client-python \ - -p pythonVersion=3.8 \ + -p pythonVersion=3.11 \ -p generateSourceCodeOnly=false \ -p library=urllib3 \ > "${CLIENT_DIR}/generate.log" 2>&1 @@ -152,18 +169,28 @@ EOF # Copy generated files while preserving important directories echo "Copying generated files..." -# Remove old generated content but preserve important directories and files -find "${CLIENT_DIR}" -mindepth 1 -maxdepth 1 \ - ! -name '.git' \ - ! -name '.github' \ - ! -name '.ibutsu-env' \ - ! -name 'regenerate-client.sh' \ - ! -name 'LICENSE' \ - ! -name 'tmp' \ - -exec rm -rf {} + - -# Copy new generated content -cp -r "${TEMP_DIR}"/. "${CLIENT_DIR}/" + +# Only remove and update the specific directories that contain generated content +echo "Removing old generated content..." +rm -rf "${CLIENT_DIR}/ibutsu_client" +rm -rf "${CLIENT_DIR}/docs" +rm -rf "${CLIENT_DIR}/test" + +# Copy only the generated content directories we want to update +echo "Copying new generated content..." +if [[ -d "${TEMP_DIR}/ibutsu_client" ]]; then + cp -r "${TEMP_DIR}/ibutsu_client" "${CLIENT_DIR}/" +fi +if [[ -d "${TEMP_DIR}/docs" ]]; then + cp -r "${TEMP_DIR}/docs" "${CLIENT_DIR}/" +fi +if [[ -d "${TEMP_DIR}/test" ]]; then + cp -r "${TEMP_DIR}/test" "${CLIENT_DIR}/" +fi + +# Note: We only copy the specific directories we need (ibutsu_client, docs, test) +# All packaging files (README.md, pyproject.toml, LICENSE, AGENTS.md) are preserved +# We do NOT copy any CI/CD files, setup files, or other generated project files # Clean up temporary directory rm -rf "${CLIENT_DIR}/tmp" diff --git a/test/test_account_recovery.py b/test/test_account_recovery.py index 1e989ec..bcfa0f7 100644 --- a/test/test_account_recovery.py +++ b/test/test_account_recovery.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.account_recovery import AccountRecovery + class TestAccountRecovery(unittest.TestCase): """AccountRecovery unit test stubs""" @@ -19,10 +23,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> AccountRecovery: + """Test AccountRecovery + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `AccountRecovery` + """ + model = AccountRecovery() + if include_optional: + return AccountRecovery( + email = 'user@domain.com' + ) + else: + return AccountRecovery( + email = 'user@domain.com', + ) + """ + def testAccountRecovery(self): """Test AccountRecovery""" - # FIXME: construct object with mandatory attributes with example values - # model = AccountRecovery() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_account_registration.py b/test/test_account_registration.py index 3c46884..59277b5 100644 --- a/test/test_account_registration.py +++ b/test/test_account_registration.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.account_registration import AccountRegistration + class TestAccountRegistration(unittest.TestCase): """AccountRegistration unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> AccountRegistration: + """Test AccountRegistration + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `AccountRegistration` + """ + model = AccountRegistration() + if include_optional: + return AccountRegistration( + email = 'user@domain.com', + password = 'supersecretpassword' + ) + else: + return AccountRegistration( + email = 'user@domain.com', + password = 'supersecretpassword', + ) + """ + def testAccountRegistration(self): """Test AccountRegistration""" - # FIXME: construct object with mandatory attributes with example values - # model = AccountRegistration() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_account_reset.py b/test/test_account_reset.py index ff0dfc4..9bab3f0 100644 --- a/test/test_account_reset.py +++ b/test/test_account_reset.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.account_reset import AccountReset + class TestAccountReset(unittest.TestCase): """AccountReset unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> AccountReset: + """Test AccountReset + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `AccountReset` + """ + model = AccountReset() + if include_optional: + return AccountReset( + activation_code = 'YjdmYWFkMTItNzkxZC00MjE4LTgwZGItOWFlOWM2Y2RhOTM5', + password = 'supersecretpassword' + ) + else: + return AccountReset( + activation_code = 'YjdmYWFkMTItNzkxZC00MjE4LTgwZGItOWFlOWM2Y2RhOTM5', + password = 'supersecretpassword', + ) + """ + def testAccountReset(self): """Test AccountReset""" - # FIXME: construct object with mandatory attributes with example values - # model = AccountReset() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_admin_project_management_api.py b/test/test_admin_project_management_api.py index 30d7fbc..badc1dd 100644 --- a/test/test_admin_project_management_api.py +++ b/test/test_admin_project_management_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,37 +17,37 @@ class TestAdminProjectManagementApi(unittest.TestCase): """AdminProjectManagementApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = AdminProjectManagementApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_admin_add_project(self): + def test_admin_add_project(self) -> None: """Test case for admin_add_project Administration endpoint to manually add a project. Only accessible to superadmins. """ - def test_admin_delete_project(self): + def test_admin_delete_project(self) -> None: """Test case for admin_delete_project Administration endpoint to delete a project. Only accessible to superadmins. """ - def test_admin_get_project(self): + def test_admin_get_project(self) -> None: """Test case for admin_get_project Administration endpoint to return a project. Only accessible to superadmins. """ - def test_admin_get_project_list(self): + def test_admin_get_project_list(self) -> None: """Test case for admin_get_project_list Administration endpoint to return a list of projects. Only accessible to superadmins. """ - def test_admin_update_project(self): + def test_admin_update_project(self) -> None: """Test case for admin_update_project Administration endpoint to update a project. Only accessible to superadmins. diff --git a/test/test_admin_user_management_api.py b/test/test_admin_user_management_api.py index dca44c7..2759a3d 100644 --- a/test/test_admin_user_management_api.py +++ b/test/test_admin_user_management_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,37 +17,37 @@ class TestAdminUserManagementApi(unittest.TestCase): """AdminUserManagementApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = AdminUserManagementApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_admin_add_user(self): + def test_admin_add_user(self) -> None: """Test case for admin_add_user Administration endpoint to manually add a user. Only accessible to superadmins. """ - def test_admin_delete_user(self): + def test_admin_delete_user(self) -> None: """Test case for admin_delete_user Administration endpoint to delete a user. Only accessible to superadmins. """ - def test_admin_get_user(self): + def test_admin_get_user(self) -> None: """Test case for admin_get_user Administration endpoint to return a user. Only accessible to superadmins. """ - def test_admin_get_user_list(self): + def test_admin_get_user_list(self) -> None: """Test case for admin_get_user_list Administration endpoint to return a list of users. Only accessible to superadmins. """ - def test_admin_update_user(self): + def test_admin_update_user(self) -> None: """Test case for admin_update_user Administration endpoint to update a user. Only accessible to superadmins. diff --git a/test/test_artifact.py b/test/test_artifact.py index b5d0a7e..c1f6e7a 100644 --- a/test/test_artifact.py +++ b/test/test_artifact.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.artifact import Artifact + class TestArtifact(unittest.TestCase): """Artifact unit test stubs""" @@ -19,10 +23,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Artifact: + """Test Artifact + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Artifact` + """ + model = Artifact() + if include_optional: + return Artifact( + id = '22785097-a256-4aad-874b-9c204caba341', + result_id = 'a16ad60e-bf23-4195-99dc-594858ad3e5e', + run_id = '04af3d2a-55c5-4562-9ed6-3bf30ac6753e', + filename = '', + additional_metadata = None, + upload_date = '' + ) + else: + return Artifact( + ) + """ + def testArtifact(self): """Test Artifact""" - # FIXME: construct object with mandatory attributes with example values - # model = Artifact() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_artifact_api.py b/test/test_artifact_api.py index d02f5aa..7c00da6 100644 --- a/test/test_artifact_api.py +++ b/test/test_artifact_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,43 +17,43 @@ class TestArtifactApi(unittest.TestCase): """ArtifactApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = ArtifactApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_delete_artifact(self): + def test_delete_artifact(self) -> None: """Test case for delete_artifact Delete an artifact """ - def test_download_artifact(self): + def test_download_artifact(self) -> None: """Test case for download_artifact Download an artifact """ - def test_get_artifact(self): + def test_get_artifact(self) -> None: """Test case for get_artifact Get a single artifact """ - def test_get_artifact_list(self): + def test_get_artifact_list(self) -> None: """Test case for get_artifact_list Get a (filtered) list of artifacts """ - def test_upload_artifact(self): + def test_upload_artifact(self) -> None: """Test case for upload_artifact Uploads a test run artifact """ - def test_view_artifact(self): + def test_view_artifact(self) -> None: """Test case for view_artifact Stream an artifact directly to the client/browser diff --git a/test/test_artifact_list.py b/test/test_artifact_list.py index 116e775..db2883c 100644 --- a/test/test_artifact_list.py +++ b/test/test_artifact_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.artifact import Artifact -from ibutsu_client.model.pagination import Pagination - -globals()["Artifact"] = Artifact -globals()["Pagination"] = Pagination +from ibutsu_client.models.artifact_list import ArtifactList class TestArtifactList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ArtifactList: + """Test ArtifactList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ArtifactList` + """ + model = ArtifactList() + if include_optional: + return ArtifactList( + artifacts = [ + {"filename":"filename","result_id":"a16ad60e-bf23-4195-99dc-594858ad3e5e","id":"22785097-a256-4aad-874b-9c204caba341","additional_metadata":{"key":"{}"},"upload_date":"2021-03-08T14:48:51+00:00"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return ArtifactList( + ) + """ + def testArtifactList(self): """Test ArtifactList""" - # FIXME: construct object with mandatory attributes with example values - # model = ArtifactList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_create_token.py b/test/test_create_token.py index 77dfcd5..7bafd62 100644 --- a/test/test_create_token.py +++ b/test/test_create_token.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.create_token import CreateToken + class TestCreateToken(unittest.TestCase): """CreateToken unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateToken: + """Test CreateToken + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `CreateToken` + """ + model = CreateToken() + if include_optional: + return CreateToken( + name = 'My user token', + expires = '2038-12-31T23:59:59+0000' + ) + else: + return CreateToken( + name = 'My user token', + expires = '2038-12-31T23:59:59+0000', + ) + """ + def testCreateToken(self): """Test CreateToken""" - # FIXME: construct object with mandatory attributes with example values - # model = CreateToken() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_credentials.py b/test/test_credentials.py index bd832e4..2a7ede4 100644 --- a/test/test_credentials.py +++ b/test/test_credentials.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.credentials import Credentials + class TestCredentials(unittest.TestCase): """Credentials unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Credentials: + """Test Credentials + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Credentials` + """ + model = Credentials() + if include_optional: + return Credentials( + email = 'me@example.com', + password = 'mysupersecretpassword' + ) + else: + return Credentials( + email = 'me@example.com', + password = 'mysupersecretpassword', + ) + """ + def testCredentials(self): """Test Credentials""" - # FIXME: construct object with mandatory attributes with example values - # model = Credentials() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_dashboard.py b/test/test_dashboard.py index b3fa67c..e7567c0 100644 --- a/test/test_dashboard.py +++ b/test/test_dashboard.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.dashboard import Dashboard + class TestDashboard(unittest.TestCase): """Dashboard unit test stubs""" @@ -19,10 +23,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Dashboard: + """Test Dashboard + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Dashboard` + """ + model = Dashboard() + if include_optional: + return Dashboard( + id = '62faa4ce-d264-46c2-813e-579949c8ab9b', + title = 'My Dashboard', + description = 'A dashboard for me', + filters = '', + project_id = '44941c55-9736-42f6-acce-ca3c4739d0f3', + user_id = '90be2a4a-1a4d-4779-b40f-f08ccd7101d5' + ) + else: + return Dashboard( + ) + """ + def testDashboard(self): """Test Dashboard""" - # FIXME: construct object with mandatory attributes with example values - # model = Dashboard() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_dashboard_api.py b/test/test_dashboard_api.py index bcc0612..89511ff 100644 --- a/test/test_dashboard_api.py +++ b/test/test_dashboard_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,37 +17,37 @@ class TestDashboardApi(unittest.TestCase): """DashboardApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = DashboardApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_dashboard(self): + def test_add_dashboard(self) -> None: """Test case for add_dashboard Create a dashboard """ - def test_delete_dashboard(self): + def test_delete_dashboard(self) -> None: """Test case for delete_dashboard Delete a dashboard """ - def test_get_dashboard(self): + def test_get_dashboard(self) -> None: """Test case for get_dashboard Get a single dashboard by ID """ - def test_get_dashboard_list(self): + def test_get_dashboard_list(self) -> None: """Test case for get_dashboard_list Get a list of dashboards """ - def test_update_dashboard(self): + def test_update_dashboard(self) -> None: """Test case for update_dashboard Update a dashboard diff --git a/test/test_dashboard_list.py b/test/test_dashboard_list.py index d62ac6b..de147a5 100644 --- a/test/test_dashboard_list.py +++ b/test/test_dashboard_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.dashboard import Dashboard -from ibutsu_client.model.pagination import Pagination - -globals()["Dashboard"] = Dashboard -globals()["Pagination"] = Pagination +from ibutsu_client.models.dashboard_list import DashboardList class TestDashboardList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> DashboardList: + """Test DashboardList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `DashboardList` + """ + model = DashboardList() + if include_optional: + return DashboardList( + dashboards = [ + {"id":"62faa4ce-d264-46c2-813e-579949c8ab9b","title":"My Dashboard","description":"A dashboard for me","filters":"","project_id":"44941c55-9736-42f6-acce-ca3c4739d0f3","user_id":"90be2a4a-1a4d-4779-b40f-f08ccd7101d5"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return DashboardList( + ) + """ + def testDashboardList(self): """Test DashboardList""" - # FIXME: construct object with mandatory attributes with example values - # model = DashboardList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_get_report_types200_response_inner.py b/test/test_get_report_types200_response_inner.py index d5f4c14..346799c 100644 --- a/test/test_get_report_types200_response_inner.py +++ b/test/test_get_report_types200_response_inner.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.get_report_types200_response_inner import GetReportTypes200ResponseInner + class TestGetReportTypes200ResponseInner(unittest.TestCase): """GetReportTypes200ResponseInner unit test stubs""" @@ -19,10 +23,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> GetReportTypes200ResponseInner: + """Test GetReportTypes200ResponseInner + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `GetReportTypes200ResponseInner` + """ + model = GetReportTypes200ResponseInner() + if include_optional: + return GetReportTypes200ResponseInner( + type = 'csv', + name = 'CSV' + ) + else: + return GetReportTypes200ResponseInner( + ) + """ + def testGetReportTypes200ResponseInner(self): """Test GetReportTypes200ResponseInner""" - # FIXME: construct object with mandatory attributes with example values - # model = GetReportTypes200ResponseInner() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_group.py b/test/test_group.py index 2fa099c..9a1c861 100644 --- a/test/test_group.py +++ b/test/test_group.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.group import Group + class TestGroup(unittest.TestCase): """Group unit test stubs""" @@ -19,10 +23,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Group: + """Test Group + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Group` + """ + model = Group() + if include_optional: + return Group( + id = 'a16ad60e-bf23-4195-99dc-594858ad3e5e', + name = 'Group A' + ) + else: + return Group( + ) + """ + def testGroup(self): """Test Group""" - # FIXME: construct object with mandatory attributes with example values - # model = Group() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_group_api.py b/test/test_group_api.py index 7b7d700..5af5b12 100644 --- a/test/test_group_api.py +++ b/test/test_group_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,31 +17,31 @@ class TestGroupApi(unittest.TestCase): """GroupApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = GroupApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_group(self): + def test_add_group(self) -> None: """Test case for add_group Create a new group """ - def test_get_group(self): + def test_get_group(self) -> None: """Test case for get_group Get a group """ - def test_get_group_list(self): + def test_get_group_list(self) -> None: """Test case for get_group_list Get a list of groups """ - def test_update_group(self): + def test_update_group(self) -> None: """Test case for update_group Update a group diff --git a/test/test_group_list.py b/test/test_group_list.py index 76017b0..040944d 100644 --- a/test/test_group_list.py +++ b/test/test_group_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.group import Group -from ibutsu_client.model.pagination import Pagination - -globals()["Group"] = Group -globals()["Pagination"] = Pagination +from ibutsu_client.models.group_list import GroupList class TestGroupList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> GroupList: + """Test GroupList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `GroupList` + """ + model = GroupList() + if include_optional: + return GroupList( + groups = [ + {"id":"a16ad60e-bf23-4195-99dc-594858ad3e5e","name":"Example group"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return GroupList( + ) + """ + def testGroupList(self): """Test GroupList""" - # FIXME: construct object with mandatory attributes with example values - # model = GroupList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_health.py b/test/test_health.py index da95941..85c18ef 100644 --- a/test/test_health.py +++ b/test/test_health.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.health import Health + class TestHealth(unittest.TestCase): """Health unit test stubs""" @@ -19,10 +23,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Health: + """Test Health + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Health` + """ + model = Health() + if include_optional: + return Health( + status = 'Error', + message = 'Cannot connect to database' + ) + else: + return Health( + ) + """ + def testHealth(self): """Test Health""" - # FIXME: construct object with mandatory attributes with example values - # model = Health() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_health_api.py b/test/test_health_api.py index 08a027f..9020e90 100644 --- a/test/test_health_api.py +++ b/test/test_health_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,25 +17,25 @@ class TestHealthApi(unittest.TestCase): """HealthApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = HealthApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_database_health(self): + def test_get_database_health(self) -> None: """Test case for get_database_health Get a health report for the database """ - def test_get_health(self): + def test_get_health(self) -> None: """Test case for get_health Get a general health report """ - def test_get_health_info(self): + def test_get_health_info(self) -> None: """Test case for get_health_info Get information about the server diff --git a/test/test_health_info.py b/test/test_health_info.py index 80fcd34..cc8dfa6 100644 --- a/test/test_health_info.py +++ b/test/test_health_info.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.health_info import HealthInfo + class TestHealthInfo(unittest.TestCase): """HealthInfo unit test stubs""" @@ -19,10 +23,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> HealthInfo: + """Test HealthInfo + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `HealthInfo` + """ + model = HealthInfo() + if include_optional: + return HealthInfo( + frontend = 'http://localhost:3000', + backend = 'http://localhost:8080', + api_ui = 'http://localhost:8080/api/ui/' + ) + else: + return HealthInfo( + ) + """ + def testHealthInfo(self): """Test HealthInfo""" - # FIXME: construct object with mandatory attributes with example values - # model = HealthInfo() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_import_api.py b/test/test_import_api.py index 555149e..3f56f57 100644 --- a/test/test_import_api.py +++ b/test/test_import_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,19 +17,19 @@ class TestImportApi(unittest.TestCase): """ImportApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = ImportApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_import(self): + def test_add_import(self) -> None: """Test case for add_import Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive """ - def test_get_import(self): + def test_get_import(self) -> None: """Test case for get_import Get the status of an import diff --git a/test/test_login_api.py b/test/test_login_api.py index 2b9a6a6..5e91f4b 100644 --- a/test/test_login_api.py +++ b/test/test_login_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,34 +17,34 @@ class TestLoginApi(unittest.TestCase): """LoginApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = LoginApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_activate(self): + def test_activate(self) -> None: """Test case for activate""" - def test_auth(self): + def test_auth(self) -> None: """Test case for auth""" - def test_config(self): + def test_config(self) -> None: """Test case for config""" - def test_login(self): + def test_login(self) -> None: """Test case for login""" - def test_recover(self): + def test_recover(self) -> None: """Test case for recover""" - def test_register(self): + def test_register(self) -> None: """Test case for register""" - def test_reset_password(self): + def test_reset_password(self) -> None: """Test case for reset_password""" - def test_support(self): + def test_support(self) -> None: """Test case for support""" diff --git a/test/test_login_config.py b/test/test_login_config.py index 0cfd354..b45a7a7 100644 --- a/test/test_login_config.py +++ b/test/test_login_config.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.login_config import LoginConfig + class TestLoginConfig(unittest.TestCase): """LoginConfig unit test stubs""" @@ -19,10 +23,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> LoginConfig: + """Test LoginConfig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `LoginConfig` + """ + model = LoginConfig() + if include_optional: + return LoginConfig( + client_id = 'ff542f48922114019fc5befd0fa0e107b494c365fa4f8af09f3fcb2eb6dc0f77', + redirect_uri = '/api/login/oauth', + scope = 'read:user' + ) + else: + return LoginConfig( + ) + """ + def testLoginConfig(self): """Test LoginConfig""" - # FIXME: construct object with mandatory attributes with example values - # model = LoginConfig() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_login_error.py b/test/test_login_error.py index a88daf4..b0320cb 100644 --- a/test/test_login_error.py +++ b/test/test_login_error.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.login_error import LoginError + class TestLoginError(unittest.TestCase): """LoginError unit test stubs""" @@ -19,10 +23,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> LoginError: + """Test LoginError + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `LoginError` + """ + model = LoginError() + if include_optional: + return LoginError( + code = 'ERR01', + message = 'Username or password was invalid' + ) + else: + return LoginError( + ) + """ + def testLoginError(self): """Test LoginError""" - # FIXME: construct object with mandatory attributes with example values - # model = LoginError() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_login_support.py b/test/test_login_support.py index ab35024..c4125e0 100644 --- a/test/test_login_support.py +++ b/test/test_login_support.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.login_support import LoginSupport + class TestLoginSupport(unittest.TestCase): """LoginSupport unit test stubs""" @@ -19,10 +23,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> LoginSupport: + """Test LoginSupport + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `LoginSupport` + """ + model = LoginSupport() + if include_optional: + return LoginSupport( + user = True, + keycloak = True, + google = True, + github = True, + facebook = True, + gitlab = True + ) + else: + return LoginSupport( + ) + """ + def testLoginSupport(self): """Test LoginSupport""" - # FIXME: construct object with mandatory attributes with example values - # model = LoginSupport() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_login_token.py b/test/test_login_token.py index 7de1784..e9315ff 100644 --- a/test/test_login_token.py +++ b/test/test_login_token.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.login_token import LoginToken + class TestLoginToken(unittest.TestCase): """LoginToken unit test stubs""" @@ -19,10 +23,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> LoginToken: + """Test LoginToken + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `LoginToken` + """ + model = LoginToken() + if include_optional: + return LoginToken( + token = 'eyJhbGciOiJIUzI1NiJ9.SGVsbG8sIHdvcmxkIQ.onO9Ihudz3WkiauDO2Uhyuz0Y18UASXlSc1eS0NkWyA' + ) + else: + return LoginToken( + ) + """ + def testLoginToken(self): """Test LoginToken""" - # FIXME: construct object with mandatory attributes with example values - # model = LoginToken() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_model_import.py b/test/test_model_import.py index e465f8c..866b3af 100644 --- a/test/test_model_import.py +++ b/test/test_model_import.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.model_import import ModelImport + class TestModelImport(unittest.TestCase): """ModelImport unit test stubs""" @@ -19,10 +23,31 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ModelImport: + """Test ModelImport + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ModelImport` + """ + model = ModelImport() + if include_optional: + return ModelImport( + id = 'e56740ba-0dbb-43ac-a556-364eefbf1f62', + status = 'done', + filename = 'test-run.xml', + format = 'JUnit', + run_id = '64c2ab9e-cd64-4815-bf73-83b00c2e650f' + ) + else: + return ModelImport( + ) + """ + def testModelImport(self): """Test ModelImport""" - # FIXME: construct object with mandatory attributes with example values - # model = ModelImport() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_pagination.py b/test/test_pagination.py index 8622351..3838c4f 100644 --- a/test/test_pagination.py +++ b/test/test_pagination.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.pagination import Pagination + class TestPagination(unittest.TestCase): """Pagination unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Pagination: + """Test Pagination + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Pagination` + """ + model = Pagination() + if include_optional: + return Pagination( + page = 2, + page_size = 25, + total_pages = 10, + total_items = 243 + ) + else: + return Pagination( + ) + """ + def testPagination(self): """Test Pagination""" - # FIXME: construct object with mandatory attributes with example values - # model = Pagination() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_project.py b/test/test_project.py index f5bc3bc..7def128 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.project import Project + class TestProject(unittest.TestCase): """Project unit test stubs""" @@ -19,10 +23,31 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Project: + """Test Project + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Project` + """ + model = Project() + if include_optional: + return Project( + id = '44941c55-9736-42f6-acce-ca3c4739d0f3', + name = 'my-project', + title = 'My project', + owner_id = '6b8b01ad-a17e-4ca1-8df5-fadb41439567', + group_id = 'a16ad60e-bf23-4195-99dc-594858ad3e5e' + ) + else: + return Project( + ) + """ + def testProject(self): """Test Project""" - # FIXME: construct object with mandatory attributes with example values - # model = Project() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_project_api.py b/test/test_project_api.py index 2ea37a6..7d9fc96 100644 --- a/test/test_project_api.py +++ b/test/test_project_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,31 +17,37 @@ class TestProjectApi(unittest.TestCase): """ProjectApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = ProjectApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_project(self): + def test_add_project(self) -> None: """Test case for add_project Create a project """ - def test_get_project(self): + def test_get_filter_params(self) -> None: + """Test case for get_filter_params + + Get a project's filterable parameters + """ + + def test_get_project(self) -> None: """Test case for get_project Get a single project by ID """ - def test_get_project_list(self): + def test_get_project_list(self) -> None: """Test case for get_project_list Get a list of projects """ - def test_update_project(self): + def test_update_project(self) -> None: """Test case for update_project Update a project diff --git a/test/test_project_list.py b/test/test_project_list.py index 970ac4c..03862f7 100644 --- a/test/test_project_list.py +++ b/test/test_project_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.project import Project - -globals()["Pagination"] = Pagination -globals()["Project"] = Project +from ibutsu_client.models.project_list import ProjectList class TestProjectList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ProjectList: + """Test ProjectList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ProjectList` + """ + model = ProjectList() + if include_optional: + return ProjectList( + projects = [ + {"id":"44941c55-9736-42f6-acce-ca3c4739d0f3","name":"my-project","title":"My Project","owner_id":"6b8b01ad-a17e-4ca1-8df5-fadb41439567","group_id":"a16ad60e-bf23-4195-99dc-594858ad3e5e"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return ProjectList( + ) + """ + def testProjectList(self): """Test ProjectList""" - # FIXME: construct object with mandatory attributes with example values - # model = ProjectList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_report.py b/test/test_report.py index b035f37..82c15fa 100644 --- a/test/test_report.py +++ b/test/test_report.py @@ -3,15 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.report_parameters import ReportParameters - -globals()["ReportParameters"] = ReportParameters +from ibutsu_client.models.report import Report class TestReport(unittest.TestCase): @@ -23,10 +23,34 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Report: + """Test Report + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Report` + """ + model = Report() + if include_optional: + return Report( + id = 'a9560d7d-dbe4-4a7f-8d09-dde6b5b137ae', + filename = 'myreport.zip', + mimetype = 'application/zip', + url = 'http://ibutsu/reports/download/myreport.zip', + download_url = 'http://ibutsu/reports/download/myreport.zip', + view_url = 'http://ibutsu/reports/view/myreport.html', + parameters = {"type":"dashboard","filter":"test_navigation","source":"iqe-jenkins"}, + status = 'done' + ) + else: + return Report( + ) + """ + def testReport(self): """Test Report""" - # FIXME: construct object with mandatory attributes with example values - # model = Report() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_report_api.py b/test/test_report_api.py index 1a161bc..31be8d5 100644 --- a/test/test_report_api.py +++ b/test/test_report_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,49 +17,49 @@ class TestReportApi(unittest.TestCase): """ReportApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = ReportApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_report(self): + def test_add_report(self) -> None: """Test case for add_report Create a new report """ - def test_delete_report(self): + def test_delete_report(self) -> None: """Test case for delete_report Delete a report """ - def test_download_report(self): + def test_download_report(self) -> None: """Test case for download_report Download a report """ - def test_get_report(self): + def test_get_report(self) -> None: """Test case for get_report Get a report """ - def test_get_report_list(self): + def test_get_report_list(self) -> None: """Test case for get_report_list Get a list of reports """ - def test_get_report_types(self): + def test_get_report_types(self) -> None: """Test case for get_report_types Get a list of report types """ - def test_view_report(self): + def test_view_report(self) -> None: """Test case for view_report View a report diff --git a/test/test_report_list.py b/test/test_report_list.py index de4b22b..d68eda7 100644 --- a/test/test_report_list.py +++ b/test/test_report_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.report import Report - -globals()["Pagination"] = Pagination -globals()["Report"] = Report +from ibutsu_client.models.report_list import ReportList class TestReportList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ReportList: + """Test ReportList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ReportList` + """ + model = ReportList() + if include_optional: + return ReportList( + reports = [ + {"id":"a9560d7d-dbe4-4a7f-8d09-dde6b5b137ae","filename":"myreport.zip","mimetype":"application/zip","url":"http://ibutsu/reports/download/myreport.zip","download_url":"http://ibutsu/reports/download/myreport.zip","view_url":"http://ibutsu/reports/view/myreport.zip","parameters":{"type":"dashboard","filter":"test_navigation","source":"iqe-jenkins"},"status":"done"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return ReportList( + ) + """ + def testReportList(self): """Test ReportList""" - # FIXME: construct object with mandatory attributes with example values - # model = ReportList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_report_parameters.py b/test/test_report_parameters.py index da52b4f..23f6783 100644 --- a/test/test_report_parameters.py +++ b/test/test_report_parameters.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.report_parameters import ReportParameters + class TestReportParameters(unittest.TestCase): """ReportParameters unit test stubs""" @@ -19,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ReportParameters: + """Test ReportParameters + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ReportParameters` + """ + model = ReportParameters() + if include_optional: + return ReportParameters( + type = 'dashboard', + filter = 'test_navigation', + source = 'iqe-jenkins' + ) + else: + return ReportParameters( + type = 'dashboard', + ) + """ + def testReportParameters(self): """Test ReportParameters""" - # FIXME: construct object with mandatory attributes with example values - # model = ReportParameters() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_result.py b/test/test_result.py index 4ef6f66..acb9525 100644 --- a/test/test_result.py +++ b/test/test_result.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.result import Result + class TestResult(unittest.TestCase): """Result unit test stubs""" @@ -19,10 +23,38 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Result: + """Test Result + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Result` + """ + model = Result() + if include_optional: + return Result( + id = 'a16ad60e-bf23-4195-99dc-594858ad3e5e', + test_id = 'test_click_on_button', + start_time = '', + duration = 1.337, + result = 'passed', + component = 'login', + env = 'qa', + run_id = '64c2ab9e-cd64-4815-bf73-83b00c2e650f', + project_id = '44941c55-9736-42f6-acce-ca3c4739d0f3', + metadata = {"jenkins":{"job_name":"test-jenkins-job","build_number":123},"project":"insights-qe","commit_hash":"F4BA3E12"}, + params = {"provider":"vmware","ip_stack":"ipv4"}, + source = '' + ) + else: + return Result( + ) + """ + def testResult(self): """Test Result""" - # FIXME: construct object with mandatory attributes with example values - # model = Result() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_result_api.py b/test/test_result_api.py index a0e2414..3499633 100644 --- a/test/test_result_api.py +++ b/test/test_result_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,31 +17,31 @@ class TestResultApi(unittest.TestCase): """ResultApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = ResultApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_result(self): + def test_add_result(self) -> None: """Test case for add_result Create a test result """ - def test_get_result(self): + def test_get_result(self) -> None: """Test case for get_result Get a single result """ - def test_get_result_list(self): + def test_get_result_list(self) -> None: """Test case for get_result_list Get the list of results. """ - def test_update_result(self): + def test_update_result(self) -> None: """Test case for update_result Updates a single result diff --git a/test/test_result_list.py b/test/test_result_list.py index d968ffe..69844f6 100644 --- a/test/test_result_list.py +++ b/test/test_result_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.result import Result - -globals()["Pagination"] = Pagination -globals()["Result"] = Result +from ibutsu_client.models.result_list import ResultList class TestResultList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ResultList: + """Test ResultList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `ResultList` + """ + model = ResultList() + if include_optional: + return ResultList( + results = [ + {"id":"a16ad60e-bf23-4195-99dc-594858ad3e5e","duration":6.027456183070403,"result":"passed","project_id":"9212ac64-348f-4c1c-90f7-fd0a45bcb47c","component":"login","env":"qa","metadata":{"jenkins":{"build_number":123,"job_name":"test-jenkins-job"},"project":"insights-qe","commit_hash":"F4BA3E12"},"start_time":"2020-05-15T16:18:32.014053","source":"source","params":{"provider":"vmware","ip_stack":"ipv4"},"test_id":"test_click_on_button"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return ResultList( + ) + """ + def testResultList(self): """Test ResultList""" - # FIXME: construct object with mandatory attributes with example values - # model = ResultList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_run.py b/test/test_run.py index 62053c8..0fd9a4c 100644 --- a/test/test_run.py +++ b/test/test_run.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.run import Run + class TestRun(unittest.TestCase): """Run unit test stubs""" @@ -19,10 +23,36 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Run: + """Test Run + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Run` + """ + model = Run() + if include_optional: + return Run( + id = '64c2ab9e-cd64-4815-bf73-83b00c2e650f', + created = '2020-05-15T16:18:32.014053', + duration = 154.778524555, + source = 'my-tests', + start_time = '2020-05-15T16:18:32.014053', + component = 'login', + env = 'qa', + project_id = '44941c55-9736-42f6-acce-ca3c4739d0f3', + summary = None, + metadata = None + ) + else: + return Run( + ) + """ + def testRun(self): """Test Run""" - # FIXME: construct object with mandatory attributes with example values - # model = Run() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_run_api.py b/test/test_run_api.py index c600b47..2d1df4e 100644 --- a/test/test_run_api.py +++ b/test/test_run_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,37 +17,37 @@ class TestRunApi(unittest.TestCase): """RunApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = RunApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_run(self): + def test_add_run(self) -> None: """Test case for add_run Create a run """ - def test_bulk_update(self): + def test_bulk_update(self) -> None: """Test case for bulk_update Update multiple runs with common metadata """ - def test_get_run(self): + def test_get_run(self) -> None: """Test case for get_run Get a single run by ID (uuid required) """ - def test_get_run_list(self): + def test_get_run_list(self) -> None: """Test case for get_run_list Get a list of the test runs """ - def test_update_run(self): + def test_update_run(self) -> None: """Test case for update_run Update a single run diff --git a/test/test_run_list.py b/test/test_run_list.py index c0b24c1..a7e452d 100644 --- a/test/test_run_list.py +++ b/test/test_run_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.run import Run - -globals()["Pagination"] = Pagination -globals()["Run"] = Run +from ibutsu_client.models.run_list import RunList class TestRunList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> RunList: + """Test RunList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `RunList` + """ + model = RunList() + if include_optional: + return RunList( + runs = [ + {"id":"64c2ab9e-cd64-4815-bf73-83b00c2e650f","created":"2020-05-15T16:18:32.014053","duration":540.05433,"source":"my-tests","start_time":"2020-05-15T16:18:32.014053","component":"login","env":"qa","summary":{"errors":1,"failures":3,"skips":0,"xfailures":0,"xpasses":1,"tests":548},"metadata":{"component":"login","env":"qa"}} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return RunList( + ) + """ + def testRunList(self): """Test RunList""" - # FIXME: construct object with mandatory attributes with example values - # model = RunList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_task_api.py b/test/test_task_api.py index 07b3153..658d1a9 100644 --- a/test/test_task_api.py +++ b/test/test_task_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,13 +17,13 @@ class TestTaskApi(unittest.TestCase): """TaskApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = TaskApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_task(self): + def test_get_task(self) -> None: """Test case for get_task Get the status or result of a task diff --git a/test/test_token.py b/test/test_token.py index a666d0f..b997691 100644 --- a/test/test_token.py +++ b/test/test_token.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.token import Token + class TestToken(unittest.TestCase): """Token unit test stubs""" @@ -19,10 +23,35 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Token: + """Test Token + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `Token` + """ + model = Token() + if include_optional: + return Token( + id = 'e2772010-bc06-47ed-8b6b-767ab87427cc', + user_id = '81e2c9d6-1593-4559-af4f-90f6f1f8fa03', + name = 'My user token', + expires = '2038-12-31T23:59:59+0000', + token = '64ad787a-5aa8-48fa-842e-6e3b9631308a' + ) + else: + return Token( + id = 'e2772010-bc06-47ed-8b6b-767ab87427cc', + user_id = '81e2c9d6-1593-4559-af4f-90f6f1f8fa03', + name = 'My user token', + token = '64ad787a-5aa8-48fa-842e-6e3b9631308a', + ) + """ + def testToken(self): """Test Token""" - # FIXME: construct object with mandatory attributes with example values - # model = Token() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_token_list.py b/test/test_token_list.py index dc261ff..5a30e2c 100644 --- a/test/test_token_list.py +++ b/test/test_token_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.token import Token - -globals()["Pagination"] = Pagination -globals()["Token"] = Token +from ibutsu_client.models.token_list import TokenList class TestTokenList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> TokenList: + """Test TokenList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `TokenList` + """ + model = TokenList() + if include_optional: + return TokenList( + tokens = [ + {"id":"e2772010-bc06-47ed-8b6b-767ab87427cc","user_id":"81e2c9d6-1593-4559-af4f-90f6f1f8fa03","name":"My user token","expires":"2038-12-31T23:59:59+0000","token":"64ad787a-5aa8-48fa-842e-6e3b9631308a"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return TokenList( + ) + """ + def testTokenList(self): """Test TokenList""" - # FIXME: construct object with mandatory attributes with example values - # model = TokenList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_update_run.py b/test/test_update_run.py index 4c78c44..821214a 100644 --- a/test/test_update_run.py +++ b/test/test_update_run.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.update_run import UpdateRun + class TestUpdateRun(unittest.TestCase): """UpdateRun unit test stubs""" @@ -19,10 +23,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> UpdateRun: + """Test UpdateRun + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `UpdateRun` + """ + model = UpdateRun() + if include_optional: + return UpdateRun( + metadata = None + ) + else: + return UpdateRun( + ) + """ + def testUpdateRun(self): """Test UpdateRun""" - # FIXME: construct object with mandatory attributes with example values - # model = UpdateRun() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_user.py b/test/test_user.py index a2c1092..f425f4f 100644 --- a/test/test_user.py +++ b/test/test_user.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.user import User + class TestUser(unittest.TestCase): """User unit test stubs""" @@ -19,10 +23,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> User: + """Test User + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `User` + """ + model = User() + if include_optional: + return User( + id = '81e2c9d6-1593-4559-af4f-90f6f1f8fa03', + email = 'user@domain.com', + name = 'Namey McNameface', + is_superadmin = False, + is_active = True, + group_id = 'a16ad60e-bf23-4195-99dc-594858ad3e5e' + ) + else: + return User( + email = 'user@domain.com', + ) + """ + def testUser(self): """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = User() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_user_api.py b/test/test_user_api.py index 433bd9b..27170ed 100644 --- a/test/test_user_api.py +++ b/test/test_user_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,43 +17,43 @@ class TestUserApi(unittest.TestCase): """UserApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = UserApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_token(self): + def test_add_token(self) -> None: """Test case for add_token Create a token for the current user """ - def test_delete_token(self): + def test_delete_token(self) -> None: """Test case for delete_token Delete the token """ - def test_get_current_user(self): + def test_get_current_user(self) -> None: """Test case for get_current_user Return the user details for the current user """ - def test_get_token(self): + def test_get_token(self) -> None: """Test case for get_token Retrieve a single token for the current user """ - def test_get_token_list(self): + def test_get_token_list(self) -> None: """Test case for get_token_list Return the tokens for the user """ - def test_update_current_user(self): + def test_update_current_user(self) -> None: """Test case for update_current_user Return the user details for the current user diff --git a/test/test_user_list.py b/test/test_user_list.py index f0475c9..63e36dc 100644 --- a/test/test_user_list.py +++ b/test/test_user_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.user import User - -globals()["Pagination"] = Pagination -globals()["User"] = User +from ibutsu_client.models.user_list import UserList class TestUserList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> UserList: + """Test UserList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `UserList` + """ + model = UserList() + if include_optional: + return UserList( + users = [ + {"id":"81e2c9d6-1593-4559-af4f-90f6f1f8fa03","email":"user@domain.com","name":"Namey McNameface","is_superadmin":false,"is_active":true,"group_id":"a16ad60e-bf23-4195-99dc-594858ad3e5e"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return UserList( + ) + """ + def testUserList(self): """Test UserList""" - # FIXME: construct object with mandatory attributes with example values - # model = UserList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_widget_api.py b/test/test_widget_api.py index dcfe4a6..2b47918 100644 --- a/test/test_widget_api.py +++ b/test/test_widget_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,19 +17,19 @@ class TestWidgetApi(unittest.TestCase): """WidgetApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = WidgetApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_widget(self): + def test_get_widget(self) -> None: """Test case for get_widget Generate data for a dashboard widget """ - def test_get_widget_types(self): + def test_get_widget_types(self) -> None: """Test case for get_widget_types Get a list of widget types diff --git a/test/test_widget_config.py b/test/test_widget_config.py index 42f7c6b..da772e0 100644 --- a/test/test_widget_config.py +++ b/test/test_widget_config.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.widget_config import WidgetConfig + class TestWidgetConfig(unittest.TestCase): """WidgetConfig unit test stubs""" @@ -19,10 +23,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> WidgetConfig: + """Test WidgetConfig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `WidgetConfig` + """ + model = WidgetConfig() + if include_optional: + return WidgetConfig( + id = 'afbcf5c7-1ffd-4367-b228-5a868c29e0ef', + type = 'widget', + widget = 'jenkins-heatmap', + project_id = '44941c55-9736-42f6-acce-ca3c4739d0f3', + weight = 0, + params = {"job_name":"integration_tests","builds":5,"group_field":"metadata.component","sort_field":"starttime"}, + title = 'Job Health' + ) + else: + return WidgetConfig( + ) + """ + def testWidgetConfig(self): """Test WidgetConfig""" - # FIXME: construct object with mandatory attributes with example values - # model = WidgetConfig() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_widget_config_api.py b/test/test_widget_config_api.py index c64ce7c..4dfd762 100644 --- a/test/test_widget_config_api.py +++ b/test/test_widget_config_api.py @@ -3,8 +3,10 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest @@ -15,37 +17,37 @@ class TestWidgetConfigApi(unittest.TestCase): """WidgetConfigApi unit test stubs""" - def setUp(self): + def setUp(self) -> None: self.api = WidgetConfigApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_widget_config(self): + def test_add_widget_config(self) -> None: """Test case for add_widget_config Create a widget configuration """ - def test_delete_widget_config(self): + def test_delete_widget_config(self) -> None: """Test case for delete_widget_config Delete a widget configuration """ - def test_get_widget_config(self): + def test_get_widget_config(self) -> None: """Test case for get_widget_config Get a single widget configuration """ - def test_get_widget_config_list(self): + def test_get_widget_config_list(self) -> None: """Test case for get_widget_config_list Get the list of widget configurations """ - def test_update_widget_config(self): + def test_update_widget_config(self) -> None: """Test case for update_widget_config Updates a single widget configuration diff --git a/test/test_widget_config_list.py b/test/test_widget_config_list.py index f7bf733..789d258 100644 --- a/test/test_widget_config_list.py +++ b/test/test_widget_config_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.widget_config import WidgetConfig - -globals()["Pagination"] = Pagination -globals()["WidgetConfig"] = WidgetConfig +from ibutsu_client.models.widget_config_list import WidgetConfigList class TestWidgetConfigList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> WidgetConfigList: + """Test WidgetConfigList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `WidgetConfigList` + """ + model = WidgetConfigList() + if include_optional: + return WidgetConfigList( + widgets = [ + {"id":"afbcf5c7-1ffd-4367-b228-5a868c29e0ef","type":"widget","widget":"jenkins-heatmap","project_id":"44941c55-9736-42f6-acce-ca3c4739d0f3","weight":0,"params":{"job_name":"integration_tests","builds":5,"group_field":"metadata.component","sort_field":"starttime"},"title":"Jenkins Pipeline Health"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return WidgetConfigList( + ) + """ + def testWidgetConfigList(self): """Test WidgetConfigList""" - # FIXME: construct object with mandatory attributes with example values - # model = WidgetConfigList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_widget_param.py b/test/test_widget_param.py index f70c248..47ee4ce 100644 --- a/test/test_widget_param.py +++ b/test/test_widget_param.py @@ -3,12 +3,16 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest +from ibutsu_client.models.widget_param import WidgetParam + class TestWidgetParam(unittest.TestCase): """WidgetParam unit test stubs""" @@ -19,10 +23,29 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> WidgetParam: + """Test WidgetParam + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `WidgetParam` + """ + model = WidgetParam() + if include_optional: + return WidgetParam( + name = 'job_name', + description = 'The Jenkins job name', + type = 'string' + ) + else: + return WidgetParam( + ) + """ + def testWidgetParam(self): """Test WidgetParam""" - # FIXME: construct object with mandatory attributes with example values - # model = WidgetParam() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_widget_type.py b/test/test_widget_type.py index 741d569..be5c1b2 100644 --- a/test/test_widget_type.py +++ b/test/test_widget_type.py @@ -3,15 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.widget_param import WidgetParam - -globals()["WidgetParam"] = WidgetParam +from ibutsu_client.models.widget_type import WidgetType class TestWidgetType(unittest.TestCase): @@ -23,10 +23,31 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> WidgetType: + """Test WidgetType + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `WidgetType` + """ + model = WidgetType() + if include_optional: + return WidgetType( + id = 'heatmap', + title = 'Heatmap', + description = 'A heatmap of runs and trends', + params = [{"name":"job_name","description":"The Jenkins job name","type":"string"},{"name":"builds","description":"The number of Jenkins builds to analyze","type":"integer"},{"name":"group_field","description":"The field in a result to group by","type":"string"},{"name":"sort_field","description":"The field to sort results by","type":"string"}], + type = 'widget' + ) + else: + return WidgetType( + ) + """ + def testWidgetType(self): """Test WidgetType""" - # FIXME: construct object with mandatory attributes with example values - # model = WidgetType() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/test/test_widget_type_list.py b/test/test_widget_type_list.py index 97c1554..25c49df 100644 --- a/test/test_widget_type_list.py +++ b/test/test_widget_type_list.py @@ -3,17 +3,15 @@ A system to store and query test results -The version of the OpenAPI document: 2.3.0 -Generated by: https://openapi-generator.tech +The version of the OpenAPI document: 2.7.4 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. """ import unittest -from ibutsu_client.model.pagination import Pagination -from ibutsu_client.model.widget_type import WidgetType - -globals()["Pagination"] = Pagination -globals()["WidgetType"] = WidgetType +from ibutsu_client.models.widget_type_list import WidgetTypeList class TestWidgetTypeList(unittest.TestCase): @@ -25,10 +23,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> WidgetTypeList: + """Test WidgetTypeList + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included""" + # uncomment below to create an instance of `WidgetTypeList` + """ + model = WidgetTypeList() + if include_optional: + return WidgetTypeList( + types = [ + {"id":"jenkins-heatmap","title":"Jenkins Pipeline Heatmap","description":"A heatmap of test runs and trends from a Jenkins pipeline","params":[{"name":"job_name","description":"The Jenkins job name","type":"string"},{"name":"builds","description":"The number of Jenkins builds to analyze","type":"integer"},{"name":"group_field","description":"The field in a result to group by","type":"string"},{"name":"sort_field","description":"The field to sort results by","type":"string"}],"type":"widget"} + ], + pagination = {"page":2,"pageSize":25,"totalPages":10,"totalItems":243} + ) + else: + return WidgetTypeList( + ) + """ + def testWidgetTypeList(self): """Test WidgetTypeList""" - # FIXME: construct object with mandatory attributes with example values - # model = WidgetTypeList() + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == "__main__": diff --git a/tests b/tests new file mode 120000 index 0000000..30d74d2 --- /dev/null +++ b/tests @@ -0,0 +1 @@ +test \ No newline at end of file