From 626d545a59661cdd11cad68e9f74a639a629b7f6 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Wed, 13 Aug 2025 12:04:26 +0300 Subject: [PATCH] feat: update version to 1.2.5 and add shared parameters support - Updated version to 1.2.5 in pyproject.toml. - Introduced new models for shared parameters, including `SharedParameter`, `SharedParameterCreate`, and related response models. - Added support for shared parameters in the API, enhancing the functionality for managing shared test configurations. - Updated documentation to reflect the new models and their usage in the API. - Enhanced changelog to document new features and improvements. --- qase-api-client/docs/ParameterGroup.md | 30 + qase-api-client/docs/ParameterShared.md | 30 + qase-api-client/docs/ParameterSingle.md | 31 + qase-api-client/docs/QqlTestCase.md | 2 +- qase-api-client/docs/QqlTestCaseParams.md | 28 + .../docs/SearchResponseAllOfResultEntities.md | 2 +- qase-api-client/docs/SharedParameter.md | 34 + qase-api-client/docs/SharedParameterCreate.md | 33 + .../docs/SharedParameterListResponse.md | 30 + .../SharedParameterListResponseAllOfResult.md | 30 + .../docs/SharedParameterParameter.md | 28 + .../docs/SharedParameterResponse.md | 30 + qase-api-client/docs/SharedParameterUpdate.md | 32 + qase-api-client/docs/SharedParametersApi.md | 438 +++++ qase-api-client/docs/TestCase.md | 1 + qase-api-client/docs/TestCaseCreate.md | 3 +- qase-api-client/docs/TestCaseParameter.md | 31 + qase-api-client/docs/TestCaseParameterBase.md | 31 + .../docs/TestCaseParameterGroup.md | 31 + .../docs/TestCaseParameterSingle.md | 31 + .../docs/TestCaseParametercreate.md | 32 + qase-api-client/docs/TestCaseParams.md | 1 + qase-api-client/docs/TestCaseQuery.md | 2 +- qase-api-client/docs/TestCaseUpdate.md | 3 +- .../docs/TestCasebulkCasesInner.md | 3 +- qase-api-client/docs/UuidResponse.md | 30 + .../docs/UuidResponseAllOfResult.md | 29 + qase-api-client/pyproject.toml | 2 +- .../src/qase/api_client_v1/__init__.py | 19 + .../src/qase/api_client_v1/api/__init__.py | 1 + .../api/shared_parameters_api.py | 1512 +++++++++++++++++ .../src/qase/api_client_v1/models/__init__.py | 18 + .../api_client_v1/models/parameter_group.py | 97 ++ .../api_client_v1/models/parameter_shared.py | 88 + .../api_client_v1/models/parameter_single.py | 90 + .../api_client_v1/models/qql_test_case.py | 6 +- .../models/qql_test_case_params.py | 139 ++ .../api_client_v1/models/shared_parameter.py | 110 ++ .../models/shared_parameter_create.py | 108 ++ .../models/shared_parameter_list_response.py | 94 + ...d_parameter_list_response_all_of_result.py | 98 ++ .../models/shared_parameter_parameter.py | 146 ++ .../models/shared_parameter_response.py | 94 + .../models/shared_parameter_update.py | 99 ++ .../qase/api_client_v1/models/test_case.py | 12 +- .../api_client_v1/models/test_case_create.py | 19 +- .../models/test_case_parameter.py | 138 ++ .../models/test_case_parameter_base.py | 105 ++ .../models/test_case_parameter_group.py | 104 ++ .../models/test_case_parameter_single.py | 104 ++ .../models/test_case_parametercreate.py | 152 ++ .../api_client_v1/models/test_case_params.py | 2 +- .../api_client_v1/models/test_case_query.py | 6 +- .../api_client_v1/models/test_case_update.py | 19 +- .../models/test_casebulk_cases_inner.py | 19 +- .../api_client_v1/models/uuid_response.py | 94 + .../models/uuid_response_all_of_result.py | 88 + 57 files changed, 4568 insertions(+), 21 deletions(-) create mode 100644 qase-api-client/docs/ParameterGroup.md create mode 100644 qase-api-client/docs/ParameterShared.md create mode 100644 qase-api-client/docs/ParameterSingle.md create mode 100644 qase-api-client/docs/QqlTestCaseParams.md create mode 100644 qase-api-client/docs/SharedParameter.md create mode 100644 qase-api-client/docs/SharedParameterCreate.md create mode 100644 qase-api-client/docs/SharedParameterListResponse.md create mode 100644 qase-api-client/docs/SharedParameterListResponseAllOfResult.md create mode 100644 qase-api-client/docs/SharedParameterParameter.md create mode 100644 qase-api-client/docs/SharedParameterResponse.md create mode 100644 qase-api-client/docs/SharedParameterUpdate.md create mode 100644 qase-api-client/docs/SharedParametersApi.md create mode 100644 qase-api-client/docs/TestCaseParameter.md create mode 100644 qase-api-client/docs/TestCaseParameterBase.md create mode 100644 qase-api-client/docs/TestCaseParameterGroup.md create mode 100644 qase-api-client/docs/TestCaseParameterSingle.md create mode 100644 qase-api-client/docs/TestCaseParametercreate.md create mode 100644 qase-api-client/docs/UuidResponse.md create mode 100644 qase-api-client/docs/UuidResponseAllOfResult.md create mode 100644 qase-api-client/src/qase/api_client_v1/api/shared_parameters_api.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/parameter_group.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/parameter_shared.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/parameter_single.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/qql_test_case_params.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_create.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response_all_of_result.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_parameter.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/shared_parameter_update.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/test_case_parameter.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/test_case_parameter_base.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/test_case_parameter_group.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/test_case_parameter_single.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/test_case_parametercreate.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/uuid_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/uuid_response_all_of_result.py diff --git a/qase-api-client/docs/ParameterGroup.md b/qase-api-client/docs/ParameterGroup.md new file mode 100644 index 00000000..c040e0ee --- /dev/null +++ b/qase-api-client/docs/ParameterGroup.md @@ -0,0 +1,30 @@ +# ParameterGroup + +Group parameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[ParameterSingle]**](ParameterSingle.md) | | + +## Example + +```python +from qase.api_client_v1.models.parameter_group import ParameterGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of ParameterGroup from a JSON string +parameter_group_instance = ParameterGroup.from_json(json) +# print the JSON string representation of the object +print(ParameterGroup.to_json()) + +# convert the object into a dict +parameter_group_dict = parameter_group_instance.to_dict() +# create an instance of ParameterGroup from a dict +parameter_group_form_dict = parameter_group.from_dict(parameter_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/qase-api-client/docs/ParameterShared.md b/qase-api-client/docs/ParameterShared.md new file mode 100644 index 00000000..f31f0d6d --- /dev/null +++ b/qase-api-client/docs/ParameterShared.md @@ -0,0 +1,30 @@ +# ParameterShared + +Shared parameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | + +## Example + +```python +from qase.api_client_v1.models.parameter_shared import ParameterShared + +# TODO update the JSON string below +json = "{}" +# create an instance of ParameterShared from a JSON string +parameter_shared_instance = ParameterShared.from_json(json) +# print the JSON string representation of the object +print(ParameterShared.to_json()) + +# convert the object into a dict +parameter_shared_dict = parameter_shared_instance.to_dict() +# create an instance of ParameterShared from a dict +parameter_shared_form_dict = parameter_shared.from_dict(parameter_shared_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/qase-api-client/docs/ParameterSingle.md b/qase-api-client/docs/ParameterSingle.md new file mode 100644 index 00000000..ccaebdff --- /dev/null +++ b/qase-api-client/docs/ParameterSingle.md @@ -0,0 +1,31 @@ +# ParameterSingle + +Single parameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**values** | **List[str]** | | + +## Example + +```python +from qase.api_client_v1.models.parameter_single import ParameterSingle + +# TODO update the JSON string below +json = "{}" +# create an instance of ParameterSingle from a JSON string +parameter_single_instance = ParameterSingle.from_json(json) +# print the JSON string representation of the object +print(ParameterSingle.to_json()) + +# convert the object into a dict +parameter_single_dict = parameter_single_instance.to_dict() +# create an instance of ParameterSingle from a dict +parameter_single_form_dict = parameter_single.from_dict(parameter_single_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/qase-api-client/docs/QqlTestCase.md b/qase-api-client/docs/QqlTestCase.md index 3952b499..121fb255 100644 --- a/qase-api-client/docs/QqlTestCase.md +++ b/qase-api-client/docs/QqlTestCase.md @@ -26,7 +26,7 @@ Name | Type | Description | Notes **attachments** | [**List[Attachment]**](Attachment.md) | | [optional] **steps_type** | **str** | | [optional] **steps** | [**List[TestStep]**](TestStep.md) | | [optional] -**params** | [**TestCaseParams**](TestCaseParams.md) | | [optional] +**params** | [**QqlTestCaseParams**](QqlTestCaseParams.md) | | [optional] **tags** | [**List[TagValue]**](TagValue.md) | | [optional] **member_id** | **int** | Deprecated, use `author_id` instead. | [optional] **author_id** | **int** | | [optional] diff --git a/qase-api-client/docs/QqlTestCaseParams.md b/qase-api-client/docs/QqlTestCaseParams.md new file mode 100644 index 00000000..955933fa --- /dev/null +++ b/qase-api-client/docs/QqlTestCaseParams.md @@ -0,0 +1,28 @@ +# QqlTestCaseParams + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from qase.api_client_v1.models.qql_test_case_params import QqlTestCaseParams + +# TODO update the JSON string below +json = "{}" +# create an instance of QqlTestCaseParams from a JSON string +qql_test_case_params_instance = QqlTestCaseParams.from_json(json) +# print the JSON string representation of the object +print(QqlTestCaseParams.to_json()) + +# convert the object into a dict +qql_test_case_params_dict = qql_test_case_params_instance.to_dict() +# create an instance of QqlTestCaseParams from a dict +qql_test_case_params_form_dict = qql_test_case_params.from_dict(qql_test_case_params_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/qase-api-client/docs/SearchResponseAllOfResultEntities.md b/qase-api-client/docs/SearchResponseAllOfResultEntities.md index 34aba426..49fd21ec 100644 --- a/qase-api-client/docs/SearchResponseAllOfResultEntities.md +++ b/qase-api-client/docs/SearchResponseAllOfResultEntities.md @@ -51,7 +51,7 @@ Name | Type | Description | Notes **milestone_id** | **int** | | [optional] **suite_id** | **int** | | [optional] **steps_type** | **str** | | [optional] -**params** | [**TestCaseParams**](TestCaseParams.md) | | [optional] +**params** | [**QqlTestCaseParams**](QqlTestCaseParams.md) | | [optional] **author_id** | **int** | | [optional] **updated_by** | **int** | Author ID of the last update. | [optional] **defect_id** | **int** | | diff --git a/qase-api-client/docs/SharedParameter.md b/qase-api-client/docs/SharedParameter.md new file mode 100644 index 00000000..49bc5c57 --- /dev/null +++ b/qase-api-client/docs/SharedParameter.md @@ -0,0 +1,34 @@ +# SharedParameter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**title** | **str** | | +**type** | **str** | | +**project_codes** | **List[str]** | | +**is_enabled_for_all_projects** | **bool** | | +**parameters** | [**SharedParameterParameter**](SharedParameterParameter.md) | | + +## Example + +```python +from qase.api_client_v1.models.shared_parameter import SharedParameter + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameter from a JSON string +shared_parameter_instance = SharedParameter.from_json(json) +# print the JSON string representation of the object +print(SharedParameter.to_json()) + +# convert the object into a dict +shared_parameter_dict = shared_parameter_instance.to_dict() +# create an instance of SharedParameter from a dict +shared_parameter_form_dict = shared_parameter.from_dict(shared_parameter_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/qase-api-client/docs/SharedParameterCreate.md b/qase-api-client/docs/SharedParameterCreate.md new file mode 100644 index 00000000..4afe0187 --- /dev/null +++ b/qase-api-client/docs/SharedParameterCreate.md @@ -0,0 +1,33 @@ +# SharedParameterCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**type** | **str** | | +**project_codes** | **List[str]** | List of project codes to associate with this shared parameter | [optional] +**is_enabled_for_all_projects** | **bool** | | +**parameters** | [**SharedParameterParameter**](SharedParameterParameter.md) | | + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_create import SharedParameterCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterCreate from a JSON string +shared_parameter_create_instance = SharedParameterCreate.from_json(json) +# print the JSON string representation of the object +print(SharedParameterCreate.to_json()) + +# convert the object into a dict +shared_parameter_create_dict = shared_parameter_create_instance.to_dict() +# create an instance of SharedParameterCreate from a dict +shared_parameter_create_form_dict = shared_parameter_create.from_dict(shared_parameter_create_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/qase-api-client/docs/SharedParameterListResponse.md b/qase-api-client/docs/SharedParameterListResponse.md new file mode 100644 index 00000000..8d8ad828 --- /dev/null +++ b/qase-api-client/docs/SharedParameterListResponse.md @@ -0,0 +1,30 @@ +# SharedParameterListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**SharedParameterListResponseAllOfResult**](SharedParameterListResponseAllOfResult.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_list_response import SharedParameterListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterListResponse from a JSON string +shared_parameter_list_response_instance = SharedParameterListResponse.from_json(json) +# print the JSON string representation of the object +print(SharedParameterListResponse.to_json()) + +# convert the object into a dict +shared_parameter_list_response_dict = shared_parameter_list_response_instance.to_dict() +# create an instance of SharedParameterListResponse from a dict +shared_parameter_list_response_form_dict = shared_parameter_list_response.from_dict(shared_parameter_list_response_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/qase-api-client/docs/SharedParameterListResponseAllOfResult.md b/qase-api-client/docs/SharedParameterListResponseAllOfResult.md new file mode 100644 index 00000000..0554dafc --- /dev/null +++ b/qase-api-client/docs/SharedParameterListResponseAllOfResult.md @@ -0,0 +1,30 @@ +# SharedParameterListResponseAllOfResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | | +**entities** | [**List[SharedParameter]**](SharedParameter.md) | | + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_list_response_all_of_result import SharedParameterListResponseAllOfResult + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterListResponseAllOfResult from a JSON string +shared_parameter_list_response_all_of_result_instance = SharedParameterListResponseAllOfResult.from_json(json) +# print the JSON string representation of the object +print(SharedParameterListResponseAllOfResult.to_json()) + +# convert the object into a dict +shared_parameter_list_response_all_of_result_dict = shared_parameter_list_response_all_of_result_instance.to_dict() +# create an instance of SharedParameterListResponseAllOfResult from a dict +shared_parameter_list_response_all_of_result_form_dict = shared_parameter_list_response_all_of_result.from_dict(shared_parameter_list_response_all_of_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/qase-api-client/docs/SharedParameterParameter.md b/qase-api-client/docs/SharedParameterParameter.md new file mode 100644 index 00000000..5a8adc93 --- /dev/null +++ b/qase-api-client/docs/SharedParameterParameter.md @@ -0,0 +1,28 @@ +# SharedParameterParameter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterParameter from a JSON string +shared_parameter_parameter_instance = SharedParameterParameter.from_json(json) +# print the JSON string representation of the object +print(SharedParameterParameter.to_json()) + +# convert the object into a dict +shared_parameter_parameter_dict = shared_parameter_parameter_instance.to_dict() +# create an instance of SharedParameterParameter from a dict +shared_parameter_parameter_form_dict = shared_parameter_parameter.from_dict(shared_parameter_parameter_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/qase-api-client/docs/SharedParameterResponse.md b/qase-api-client/docs/SharedParameterResponse.md new file mode 100644 index 00000000..edff3f6c --- /dev/null +++ b/qase-api-client/docs/SharedParameterResponse.md @@ -0,0 +1,30 @@ +# SharedParameterResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**SharedParameter**](SharedParameter.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_response import SharedParameterResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterResponse from a JSON string +shared_parameter_response_instance = SharedParameterResponse.from_json(json) +# print the JSON string representation of the object +print(SharedParameterResponse.to_json()) + +# convert the object into a dict +shared_parameter_response_dict = shared_parameter_response_instance.to_dict() +# create an instance of SharedParameterResponse from a dict +shared_parameter_response_form_dict = shared_parameter_response.from_dict(shared_parameter_response_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/qase-api-client/docs/SharedParameterUpdate.md b/qase-api-client/docs/SharedParameterUpdate.md new file mode 100644 index 00000000..8aaa3b9d --- /dev/null +++ b/qase-api-client/docs/SharedParameterUpdate.md @@ -0,0 +1,32 @@ +# SharedParameterUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | [optional] +**project_codes** | **List[str]** | List of project codes to associate with this shared parameter | [optional] +**is_enabled_for_all_projects** | **bool** | | [optional] +**parameters** | [**SharedParameterParameter**](SharedParameterParameter.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.shared_parameter_update import SharedParameterUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of SharedParameterUpdate from a JSON string +shared_parameter_update_instance = SharedParameterUpdate.from_json(json) +# print the JSON string representation of the object +print(SharedParameterUpdate.to_json()) + +# convert the object into a dict +shared_parameter_update_dict = shared_parameter_update_instance.to_dict() +# create an instance of SharedParameterUpdate from a dict +shared_parameter_update_form_dict = shared_parameter_update.from_dict(shared_parameter_update_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/qase-api-client/docs/SharedParametersApi.md b/qase-api-client/docs/SharedParametersApi.md new file mode 100644 index 00000000..8ebc6c7a --- /dev/null +++ b/qase-api-client/docs/SharedParametersApi.md @@ -0,0 +1,438 @@ +# qase.api_client_v1.SharedParametersApi + +All URIs are relative to *https://api.qase.io/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_shared_parameter**](SharedParametersApi.md#create_shared_parameter) | **POST** /shared_parameter | Create a new shared parameter +[**delete_shared_parameter**](SharedParametersApi.md#delete_shared_parameter) | **DELETE** /shared_parameter/{id} | Delete shared parameter +[**get_shared_parameter**](SharedParametersApi.md#get_shared_parameter) | **GET** /shared_parameter/{id} | Get a specific shared parameter +[**get_shared_parameters**](SharedParametersApi.md#get_shared_parameters) | **GET** /shared_parameter | Get all shared parameters +[**update_shared_parameter**](SharedParametersApi.md#update_shared_parameter) | **PATCH** /shared_parameter/{id} | Update shared parameter + + +# **create_shared_parameter** +> UuidResponse create_shared_parameter(shared_parameter_create) + +Create a new shared parameter + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.shared_parameter_create import SharedParameterCreate +from qase.api_client_v1.models.uuid_response import UuidResponse +from qase.api_client_v1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.qase.io/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = qase.api_client_v1.Configuration( + host = "https://api.qase.io/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: TokenAuth +configuration.api_key['TokenAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['TokenAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with qase.api_client_v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = qase.api_client_v1.SharedParametersApi(api_client) + shared_parameter_create = qase.api_client_v1.SharedParameterCreate() # SharedParameterCreate | + + try: + # Create a new shared parameter + api_response = api_instance.create_shared_parameter(shared_parameter_create) + print("The response of SharedParametersApi->create_shared_parameter:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SharedParametersApi->create_shared_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shared_parameter_create** | [**SharedParameterCreate**](SharedParameterCreate.md)| | + +### Return type + +[**UuidResponse**](UuidResponse.md) + +### Authorization + +[TokenAuth](../README.md#TokenAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A shared parameter. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**403** | Forbidden. | - | +**404** | Not Found. | - | +**422** | Unprocessable Entity. | - | +**429** | Too Many Requests. | - | + +[[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) + +# **delete_shared_parameter** +> UuidResponse delete_shared_parameter(id) + +Delete shared parameter + +Delete shared parameter along with all its usages in test cases and reviews. + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.uuid_response import UuidResponse +from qase.api_client_v1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.qase.io/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = qase.api_client_v1.Configuration( + host = "https://api.qase.io/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: TokenAuth +configuration.api_key['TokenAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['TokenAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with qase.api_client_v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = qase.api_client_v1.SharedParametersApi(api_client) + id = 'id_example' # str | Identifier. + + try: + # Delete shared parameter + api_response = api_instance.delete_shared_parameter(id) + print("The response of SharedParametersApi->delete_shared_parameter:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SharedParametersApi->delete_shared_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier. | + +### Return type + +[**UuidResponse**](UuidResponse.md) + +### Authorization + +[TokenAuth](../README.md#TokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**403** | Forbidden. | - | +**404** | Not Found. | - | +**429** | Too Many Requests. | - | + +[[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_shared_parameter** +> SharedParameterResponse get_shared_parameter(id) + +Get a specific shared parameter + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.shared_parameter_response import SharedParameterResponse +from qase.api_client_v1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.qase.io/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = qase.api_client_v1.Configuration( + host = "https://api.qase.io/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: TokenAuth +configuration.api_key['TokenAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['TokenAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with qase.api_client_v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = qase.api_client_v1.SharedParametersApi(api_client) + id = 'id_example' # str | Identifier. + + try: + # Get a specific shared parameter + api_response = api_instance.get_shared_parameter(id) + print("The response of SharedParametersApi->get_shared_parameter:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SharedParametersApi->get_shared_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier. | + +### Return type + +[**SharedParameterResponse**](SharedParameterResponse.md) + +### Authorization + +[TokenAuth](../README.md#TokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A shared parameter. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**403** | Forbidden. | - | +**404** | Not Found. | - | +**429** | Too Many Requests. | - | + +[[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_shared_parameters** +> SharedParameterListResponse get_shared_parameters(limit=limit, offset=offset, filters_search=filters_search, filters_type=filters_type, filters_project_codes=filters_project_codes) + +Get all shared parameters + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.shared_parameter_list_response import SharedParameterListResponse +from qase.api_client_v1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.qase.io/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = qase.api_client_v1.Configuration( + host = "https://api.qase.io/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: TokenAuth +configuration.api_key['TokenAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['TokenAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with qase.api_client_v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = qase.api_client_v1.SharedParametersApi(api_client) + limit = 10 # int | A number of entities in result set. (optional) (default to 10) + offset = 0 # int | How many entities should be skipped. (optional) (default to 0) + filters_search = 'filters_search_example' # str | (optional) + filters_type = 'filters_type_example' # str | (optional) + filters_project_codes = ['filters_project_codes_example'] # List[str] | (optional) + + try: + # Get all shared parameters + api_response = api_instance.get_shared_parameters(limit=limit, offset=offset, filters_search=filters_search, filters_type=filters_type, filters_project_codes=filters_project_codes) + print("The response of SharedParametersApi->get_shared_parameters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SharedParametersApi->get_shared_parameters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| A number of entities in result set. | [optional] [default to 10] + **offset** | **int**| How many entities should be skipped. | [optional] [default to 0] + **filters_search** | **str**| | [optional] + **filters_type** | **str**| | [optional] + **filters_project_codes** | [**List[str]**](str.md)| | [optional] + +### Return type + +[**SharedParameterListResponse**](SharedParameterListResponse.md) + +### Authorization + +[TokenAuth](../README.md#TokenAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of all shared parameters. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**403** | Forbidden. | - | +**404** | Not Found. | - | +**429** | Too Many Requests. | - | + +[[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_shared_parameter** +> UuidResponse update_shared_parameter(id, shared_parameter_update) + +Update shared parameter + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.shared_parameter_update import SharedParameterUpdate +from qase.api_client_v1.models.uuid_response import UuidResponse +from qase.api_client_v1.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.qase.io/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = qase.api_client_v1.Configuration( + host = "https://api.qase.io/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: TokenAuth +configuration.api_key['TokenAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['TokenAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with qase.api_client_v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = qase.api_client_v1.SharedParametersApi(api_client) + id = 'id_example' # str | Identifier. + shared_parameter_update = qase.api_client_v1.SharedParameterUpdate() # SharedParameterUpdate | + + try: + # Update shared parameter + api_response = api_instance.update_shared_parameter(id, shared_parameter_update) + print("The response of SharedParametersApi->update_shared_parameter:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SharedParametersApi->update_shared_parameter: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Identifier. | + **shared_parameter_update** | [**SharedParameterUpdate**](SharedParameterUpdate.md)| | + +### Return type + +[**UuidResponse**](UuidResponse.md) + +### Authorization + +[TokenAuth](../README.md#TokenAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**403** | Forbidden. | - | +**404** | Not Found. | - | +**429** | Too Many Requests. | - | + +[[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) + diff --git a/qase-api-client/docs/TestCase.md b/qase-api-client/docs/TestCase.md index a9a6c940..e00531ae 100644 --- a/qase-api-client/docs/TestCase.md +++ b/qase-api-client/docs/TestCase.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **steps_type** | **str** | | [optional] **steps** | [**List[TestStep]**](TestStep.md) | | [optional] **params** | [**TestCaseParams**](TestCaseParams.md) | | [optional] +**parameters** | [**List[TestCaseParameter]**](TestCaseParameter.md) | | [optional] **tags** | [**List[TagValue]**](TagValue.md) | | [optional] **member_id** | **int** | Deprecated, use `author_id` instead. | [optional] **author_id** | **int** | | [optional] diff --git a/qase-api-client/docs/TestCaseCreate.md b/qase-api-client/docs/TestCaseCreate.md index fc57290d..08905ff6 100644 --- a/qase-api-client/docs/TestCaseCreate.md +++ b/qase-api-client/docs/TestCaseCreate.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **attachments** | **List[str]** | A list of Attachment hashes. | [optional] **steps** | [**List[TestStepCreate]**](TestStepCreate.md) | | [optional] **tags** | **List[str]** | | [optional] -**params** | **Dict[str, List[str]]** | | [optional] +**params** | **Dict[str, List[str]]** | Deprecated, use `parameters` instead. | [optional] +**parameters** | [**List[TestCaseParametercreate]**](TestCaseParametercreate.md) | | [optional] **custom_field** | **Dict[str, str]** | A map of custom fields values (id => value) | [optional] **created_at** | **str** | | [optional] **updated_at** | **str** | | [optional] diff --git a/qase-api-client/docs/TestCaseParameter.md b/qase-api-client/docs/TestCaseParameter.md new file mode 100644 index 00000000..55b7b0da --- /dev/null +++ b/qase-api-client/docs/TestCaseParameter.md @@ -0,0 +1,31 @@ +# TestCaseParameter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | [optional] +**type** | **str** | | +**items** | **object** | | + +## Example + +```python +from qase.api_client_v1.models.test_case_parameter import TestCaseParameter + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCaseParameter from a JSON string +test_case_parameter_instance = TestCaseParameter.from_json(json) +# print the JSON string representation of the object +print(TestCaseParameter.to_json()) + +# convert the object into a dict +test_case_parameter_dict = test_case_parameter_instance.to_dict() +# create an instance of TestCaseParameter from a dict +test_case_parameter_form_dict = test_case_parameter.from_dict(test_case_parameter_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/qase-api-client/docs/TestCaseParameterBase.md b/qase-api-client/docs/TestCaseParameterBase.md new file mode 100644 index 00000000..9a197527 --- /dev/null +++ b/qase-api-client/docs/TestCaseParameterBase.md @@ -0,0 +1,31 @@ +# TestCaseParameterBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | [optional] +**type** | **str** | | +**items** | [**List[ParameterSingle]**](ParameterSingle.md) | | + +## Example + +```python +from qase.api_client_v1.models.test_case_parameter_base import TestCaseParameterBase + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCaseParameterBase from a JSON string +test_case_parameter_base_instance = TestCaseParameterBase.from_json(json) +# print the JSON string representation of the object +print(TestCaseParameterBase.to_json()) + +# convert the object into a dict +test_case_parameter_base_dict = test_case_parameter_base_instance.to_dict() +# create an instance of TestCaseParameterBase from a dict +test_case_parameter_base_form_dict = test_case_parameter_base.from_dict(test_case_parameter_base_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/qase-api-client/docs/TestCaseParameterGroup.md b/qase-api-client/docs/TestCaseParameterGroup.md new file mode 100644 index 00000000..275841ef --- /dev/null +++ b/qase-api-client/docs/TestCaseParameterGroup.md @@ -0,0 +1,31 @@ +# TestCaseParameterGroup + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | [optional] +**type** | **str** | | +**items** | **object** | | + +## Example + +```python +from qase.api_client_v1.models.test_case_parameter_group import TestCaseParameterGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCaseParameterGroup from a JSON string +test_case_parameter_group_instance = TestCaseParameterGroup.from_json(json) +# print the JSON string representation of the object +print(TestCaseParameterGroup.to_json()) + +# convert the object into a dict +test_case_parameter_group_dict = test_case_parameter_group_instance.to_dict() +# create an instance of TestCaseParameterGroup from a dict +test_case_parameter_group_form_dict = test_case_parameter_group.from_dict(test_case_parameter_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/qase-api-client/docs/TestCaseParameterSingle.md b/qase-api-client/docs/TestCaseParameterSingle.md new file mode 100644 index 00000000..a77e85c6 --- /dev/null +++ b/qase-api-client/docs/TestCaseParameterSingle.md @@ -0,0 +1,31 @@ +# TestCaseParameterSingle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | [optional] +**type** | **str** | | +**items** | **object** | | + +## Example + +```python +from qase.api_client_v1.models.test_case_parameter_single import TestCaseParameterSingle + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCaseParameterSingle from a JSON string +test_case_parameter_single_instance = TestCaseParameterSingle.from_json(json) +# print the JSON string representation of the object +print(TestCaseParameterSingle.to_json()) + +# convert the object into a dict +test_case_parameter_single_dict = test_case_parameter_single_instance.to_dict() +# create an instance of TestCaseParameterSingle from a dict +test_case_parameter_single_form_dict = test_case_parameter_single.from_dict(test_case_parameter_single_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/qase-api-client/docs/TestCaseParametercreate.md b/qase-api-client/docs/TestCaseParametercreate.md new file mode 100644 index 00000000..7d864eae --- /dev/null +++ b/qase-api-client/docs/TestCaseParametercreate.md @@ -0,0 +1,32 @@ +# TestCaseParametercreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shared_id** | **str** | | +**title** | **str** | | +**values** | **List[str]** | | +**items** | [**List[ParameterSingle]**](ParameterSingle.md) | | + +## Example + +```python +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate + +# TODO update the JSON string below +json = "{}" +# create an instance of TestCaseParametercreate from a JSON string +test_case_parametercreate_instance = TestCaseParametercreate.from_json(json) +# print the JSON string representation of the object +print(TestCaseParametercreate.to_json()) + +# convert the object into a dict +test_case_parametercreate_dict = test_case_parametercreate_instance.to_dict() +# create an instance of TestCaseParametercreate from a dict +test_case_parametercreate_form_dict = test_case_parametercreate.from_dict(test_case_parametercreate_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/qase-api-client/docs/TestCaseParams.md b/qase-api-client/docs/TestCaseParams.md index df9502e0..08feb4e4 100644 --- a/qase-api-client/docs/TestCaseParams.md +++ b/qase-api-client/docs/TestCaseParams.md @@ -1,5 +1,6 @@ # TestCaseParams +Deprecated, use `parameters` instead. ## Properties diff --git a/qase-api-client/docs/TestCaseQuery.md b/qase-api-client/docs/TestCaseQuery.md index 7864cd32..3f2d373c 100644 --- a/qase-api-client/docs/TestCaseQuery.md +++ b/qase-api-client/docs/TestCaseQuery.md @@ -26,7 +26,7 @@ Name | Type | Description | Notes **attachments** | [**List[Attachment]**](Attachment.md) | | [optional] **steps_type** | **str** | | [optional] **steps** | [**List[TestStep]**](TestStep.md) | | [optional] -**params** | [**TestCaseParams**](TestCaseParams.md) | | [optional] +**params** | [**QqlTestCaseParams**](QqlTestCaseParams.md) | | [optional] **tags** | [**List[TagValue]**](TagValue.md) | | [optional] **member_id** | **int** | Deprecated, use `author_id` instead. | [optional] **author_id** | **int** | | [optional] diff --git a/qase-api-client/docs/TestCaseUpdate.md b/qase-api-client/docs/TestCaseUpdate.md index c5baa03e..2fe81b06 100644 --- a/qase-api-client/docs/TestCaseUpdate.md +++ b/qase-api-client/docs/TestCaseUpdate.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **attachments** | **List[str]** | A list of Attachment hashes. | [optional] **steps** | [**List[TestStepCreate]**](TestStepCreate.md) | | [optional] **tags** | **List[str]** | | [optional] -**params** | **Dict[str, List[str]]** | | [optional] +**params** | **Dict[str, List[str]]** | Deprecated, use `parameters` instead. | [optional] +**parameters** | [**List[TestCaseParametercreate]**](TestCaseParametercreate.md) | | [optional] **custom_field** | **Dict[str, str]** | A map of custom fields values (id => value) | [optional] ## Example diff --git a/qase-api-client/docs/TestCasebulkCasesInner.md b/qase-api-client/docs/TestCasebulkCasesInner.md index 59af566b..f2306d1c 100644 --- a/qase-api-client/docs/TestCasebulkCasesInner.md +++ b/qase-api-client/docs/TestCasebulkCasesInner.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **attachments** | **List[str]** | A list of Attachment hashes. | [optional] **steps** | [**List[TestStepCreate]**](TestStepCreate.md) | | [optional] **tags** | **List[str]** | | [optional] -**params** | **Dict[str, List[str]]** | | [optional] +**params** | **Dict[str, List[str]]** | Deprecated, use `parameters` instead. | [optional] +**parameters** | [**List[TestCaseParametercreate]**](TestCaseParametercreate.md) | | [optional] **custom_field** | **Dict[str, str]** | A map of custom fields values (id => value) | [optional] **created_at** | **str** | | [optional] **updated_at** | **str** | | [optional] diff --git a/qase-api-client/docs/UuidResponse.md b/qase-api-client/docs/UuidResponse.md new file mode 100644 index 00000000..3e62026b --- /dev/null +++ b/qase-api-client/docs/UuidResponse.md @@ -0,0 +1,30 @@ +# UuidResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**UuidResponseAllOfResult**](UuidResponseAllOfResult.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.uuid_response import UuidResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UuidResponse from a JSON string +uuid_response_instance = UuidResponse.from_json(json) +# print the JSON string representation of the object +print(UuidResponse.to_json()) + +# convert the object into a dict +uuid_response_dict = uuid_response_instance.to_dict() +# create an instance of UuidResponse from a dict +uuid_response_form_dict = uuid_response.from_dict(uuid_response_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/qase-api-client/docs/UuidResponseAllOfResult.md b/qase-api-client/docs/UuidResponseAllOfResult.md new file mode 100644 index 00000000..53635f40 --- /dev/null +++ b/qase-api-client/docs/UuidResponseAllOfResult.md @@ -0,0 +1,29 @@ +# UuidResponseAllOfResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] + +## Example + +```python +from qase.api_client_v1.models.uuid_response_all_of_result import UuidResponseAllOfResult + +# TODO update the JSON string below +json = "{}" +# create an instance of UuidResponseAllOfResult from a JSON string +uuid_response_all_of_result_instance = UuidResponseAllOfResult.from_json(json) +# print the JSON string representation of the object +print(UuidResponseAllOfResult.to_json()) + +# convert the object into a dict +uuid_response_all_of_result_dict = uuid_response_all_of_result_instance.to_dict() +# create an instance of UuidResponseAllOfResult from a dict +uuid_response_all_of_result_form_dict = uuid_response_all_of_result.from_dict(uuid_response_all_of_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/qase-api-client/pyproject.toml b/qase-api-client/pyproject.toml index ae8229c1..ab29836f 100644 --- a/qase-api-client/pyproject.toml +++ b/qase-api-client/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "qase-api-client" -version = "1.2.4" +version = "1.2.5" description = "Qase TestOps API V1 client for Python" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] diff --git a/qase-api-client/src/qase/api_client_v1/__init__.py b/qase-api-client/src/qase/api_client_v1/__init__.py index b322476a..3f1141c3 100644 --- a/qase-api-client/src/qase/api_client_v1/__init__.py +++ b/qase-api-client/src/qase/api_client_v1/__init__.py @@ -31,6 +31,7 @@ from qase.api_client_v1.api.results_api import ResultsApi from qase.api_client_v1.api.runs_api import RunsApi from qase.api_client_v1.api.search_api import SearchApi +from qase.api_client_v1.api.shared_parameters_api import SharedParametersApi from qase.api_client_v1.api.shared_steps_api import SharedStepsApi from qase.api_client_v1.api.suites_api import SuitesApi from qase.api_client_v1.api.system_fields_api import SystemFieldsApi @@ -103,6 +104,9 @@ from qase.api_client_v1.models.milestone_list_response_all_of_result import MilestoneListResponseAllOfResult from qase.api_client_v1.models.milestone_response import MilestoneResponse from qase.api_client_v1.models.milestone_update import MilestoneUpdate +from qase.api_client_v1.models.parameter_group import ParameterGroup +from qase.api_client_v1.models.parameter_shared import ParameterShared +from qase.api_client_v1.models.parameter_single import ParameterSingle from qase.api_client_v1.models.plan import Plan from qase.api_client_v1.models.plan_create import PlanCreate from qase.api_client_v1.models.plan_detailed import PlanDetailed @@ -126,6 +130,7 @@ from qase.api_client_v1.models.qql_defect import QqlDefect from qase.api_client_v1.models.qql_plan import QqlPlan from qase.api_client_v1.models.qql_test_case import QqlTestCase +from qase.api_client_v1.models.qql_test_case_params import QqlTestCaseParams from qase.api_client_v1.models.requirement import Requirement from qase.api_client_v1.models.requirement_query import RequirementQuery from qase.api_client_v1.models.response import Response @@ -161,6 +166,13 @@ from qase.api_client_v1.models.search_response import SearchResponse from qase.api_client_v1.models.search_response_all_of_result import SearchResponseAllOfResult from qase.api_client_v1.models.search_response_all_of_result_entities import SearchResponseAllOfResultEntities +from qase.api_client_v1.models.shared_parameter import SharedParameter +from qase.api_client_v1.models.shared_parameter_create import SharedParameterCreate +from qase.api_client_v1.models.shared_parameter_list_response import SharedParameterListResponse +from qase.api_client_v1.models.shared_parameter_list_response_all_of_result import SharedParameterListResponseAllOfResult +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter +from qase.api_client_v1.models.shared_parameter_response import SharedParameterResponse +from qase.api_client_v1.models.shared_parameter_update import SharedParameterUpdate from qase.api_client_v1.models.shared_step import SharedStep from qase.api_client_v1.models.shared_step_content import SharedStepContent from qase.api_client_v1.models.shared_step_content_create import SharedStepContentCreate @@ -186,6 +198,11 @@ from qase.api_client_v1.models.test_case_external_issues_links_inner import TestCaseExternalIssuesLinksInner from qase.api_client_v1.models.test_case_list_response import TestCaseListResponse from qase.api_client_v1.models.test_case_list_response_all_of_result import TestCaseListResponseAllOfResult +from qase.api_client_v1.models.test_case_parameter import TestCaseParameter +from qase.api_client_v1.models.test_case_parameter_base import TestCaseParameterBase +from qase.api_client_v1.models.test_case_parameter_group import TestCaseParameterGroup +from qase.api_client_v1.models.test_case_parameter_single import TestCaseParameterSingle +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate from qase.api_client_v1.models.test_case_params import TestCaseParams from qase.api_client_v1.models.test_case_query import TestCaseQuery from qase.api_client_v1.models.test_case_response import TestCaseResponse @@ -197,3 +214,5 @@ from qase.api_client_v1.models.test_step_create import TestStepCreate from qase.api_client_v1.models.test_step_result import TestStepResult from qase.api_client_v1.models.test_step_result_create import TestStepResultCreate +from qase.api_client_v1.models.uuid_response import UuidResponse +from qase.api_client_v1.models.uuid_response_all_of_result import UuidResponseAllOfResult diff --git a/qase-api-client/src/qase/api_client_v1/api/__init__.py b/qase-api-client/src/qase/api_client_v1/api/__init__.py index a10d280e..7bfab22d 100644 --- a/qase-api-client/src/qase/api_client_v1/api/__init__.py +++ b/qase-api-client/src/qase/api_client_v1/api/__init__.py @@ -14,6 +14,7 @@ from qase.api_client_v1.api.results_api import ResultsApi from qase.api_client_v1.api.runs_api import RunsApi from qase.api_client_v1.api.search_api import SearchApi +from qase.api_client_v1.api.shared_parameters_api import SharedParametersApi from qase.api_client_v1.api.shared_steps_api import SharedStepsApi from qase.api_client_v1.api.suites_api import SuitesApi from qase.api_client_v1.api.system_fields_api import SystemFieldsApi diff --git a/qase-api-client/src/qase/api_client_v1/api/shared_parameters_api.py b/qase-api-client/src/qase/api_client_v1/api/shared_parameters_api.py new file mode 100644 index 00000000..b47c0234 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/api/shared_parameters_api.py @@ -0,0 +1,1512 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.shared_parameter_create import SharedParameterCreate +from qase.api_client_v1.models.shared_parameter_list_response import SharedParameterListResponse +from qase.api_client_v1.models.shared_parameter_response import SharedParameterResponse +from qase.api_client_v1.models.shared_parameter_update import SharedParameterUpdate +from qase.api_client_v1.models.uuid_response import UuidResponse + +from qase.api_client_v1.api_client import ApiClient, RequestSerialized +from qase.api_client_v1.api_response import ApiResponse +from qase.api_client_v1.rest import RESTResponseType + + +class SharedParametersApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_shared_parameter( + self, + shared_parameter_create: SharedParameterCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UuidResponse: + """Create a new shared parameter + + + :param shared_parameter_create: (required) + :type shared_parameter_create: SharedParameterCreate + :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. + """ # noqa: E501 + + _param = self._create_shared_parameter_serialize( + shared_parameter_create=shared_parameter_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '422': None, + '429': 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 create_shared_parameter_with_http_info( + self, + shared_parameter_create: SharedParameterCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UuidResponse]: + """Create a new shared parameter + + + :param shared_parameter_create: (required) + :type shared_parameter_create: SharedParameterCreate + :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. + """ # noqa: E501 + + _param = self._create_shared_parameter_serialize( + shared_parameter_create=shared_parameter_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '422': None, + '429': 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 create_shared_parameter_without_preload_content( + self, + shared_parameter_create: SharedParameterCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new shared parameter + + + :param shared_parameter_create: (required) + :type shared_parameter_create: SharedParameterCreate + :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. + """ # noqa: E501 + + _param = self._create_shared_parameter_serialize( + shared_parameter_create=shared_parameter_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '422': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_shared_parameter_serialize( + self, + shared_parameter_create, + _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, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if shared_parameter_create is not None: + _body_params = shared_parameter_create + + + # set the HTTP header `Accept` + _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] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/shared_parameter', + 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_shared_parameter( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UuidResponse: + """Delete shared parameter + + Delete shared parameter along with all its usages in test cases and reviews. + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._delete_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UuidResponse]: + """Delete shared parameter + + Delete shared parameter along with all its usages in test cases and reviews. + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._delete_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete shared parameter + + Delete shared parameter along with all its usages in test cases and reviews. + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._delete_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_shared_parameter_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, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = 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` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/shared_parameter/{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_shared_parameter( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SharedParameterResponse: + """Get a specific shared parameter + + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._get_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SharedParameterResponse]: + """Get a specific shared parameter + + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._get_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a specific shared parameter + + + :param id: Identifier. (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. + """ # noqa: E501 + + _param = self._get_shared_parameter_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_shared_parameter_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, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = 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` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/shared_parameter/{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_shared_parameters( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="A number of entities in result set.")] = None, + offset: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=0)]], Field(description="How many entities should be skipped.")] = None, + filters_search: Optional[StrictStr] = None, + filters_type: Optional[StrictStr] = None, + filters_project_codes: Optional[List[Annotated[str, Field(min_length=2, strict=True, max_length=10)]]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SharedParameterListResponse: + """Get all shared parameters + + + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param filters_search: + :type filters_search: str + :param filters_type: + :type filters_type: str + :param filters_project_codes: + :type filters_project_codes: List[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. + """ # noqa: E501 + + _param = self._get_shared_parameters_serialize( + limit=limit, + offset=offset, + filters_search=filters_search, + filters_type=filters_type, + filters_project_codes=filters_project_codes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterListResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameters_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="A number of entities in result set.")] = None, + offset: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=0)]], Field(description="How many entities should be skipped.")] = None, + filters_search: Optional[StrictStr] = None, + filters_type: Optional[StrictStr] = None, + filters_project_codes: Optional[List[Annotated[str, Field(min_length=2, strict=True, max_length=10)]]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SharedParameterListResponse]: + """Get all shared parameters + + + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param filters_search: + :type filters_search: str + :param filters_type: + :type filters_type: str + :param filters_project_codes: + :type filters_project_codes: List[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. + """ # noqa: E501 + + _param = self._get_shared_parameters_serialize( + limit=limit, + offset=offset, + filters_search=filters_search, + filters_type=filters_type, + filters_project_codes=filters_project_codes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterListResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameters_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="A number of entities in result set.")] = None, + offset: Annotated[Optional[Annotated[int, Field(le=100000, strict=True, ge=0)]], Field(description="How many entities should be skipped.")] = None, + filters_search: Optional[StrictStr] = None, + filters_type: Optional[StrictStr] = None, + filters_project_codes: Optional[List[Annotated[str, Field(min_length=2, strict=True, max_length=10)]]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get all shared parameters + + + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param filters_search: + :type filters_search: str + :param filters_type: + :type filters_type: str + :param filters_project_codes: + :type filters_project_codes: List[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. + """ # noqa: E501 + + _param = self._get_shared_parameters_serialize( + limit=limit, + offset=offset, + filters_search=filters_search, + filters_type=filters_type, + filters_project_codes=filters_project_codes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SharedParameterListResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_shared_parameters_serialize( + self, + limit, + offset, + filters_search, + filters_type, + filters_project_codes, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'filters[project_codes][]': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if filters_search is not None: + + _query_params.append(('filters[search]', filters_search)) + + if filters_type is not None: + + _query_params.append(('filters[type]', filters_type)) + + if filters_project_codes is not None: + + _query_params.append(('filters[project_codes][]', filters_project_codes)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/shared_parameter', + 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_shared_parameter( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + shared_parameter_update: SharedParameterUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UuidResponse: + """Update shared parameter + + + :param id: Identifier. (required) + :type id: str + :param shared_parameter_update: (required) + :type shared_parameter_update: SharedParameterUpdate + :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. + """ # noqa: E501 + + _param = self._update_shared_parameter_serialize( + id=id, + shared_parameter_update=shared_parameter_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + shared_parameter_update: SharedParameterUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UuidResponse]: + """Update shared parameter + + + :param id: Identifier. (required) + :type id: str + :param shared_parameter_update: (required) + :type shared_parameter_update: SharedParameterUpdate + :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. + """ # noqa: E501 + + _param = self._update_shared_parameter_serialize( + id=id, + shared_parameter_update=shared_parameter_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': 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_shared_parameter_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Identifier.")], + shared_parameter_update: SharedParameterUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update shared parameter + + + :param id: Identifier. (required) + :type id: str + :param shared_parameter_update: (required) + :type shared_parameter_update: SharedParameterUpdate + :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. + """ # noqa: E501 + + _param = self._update_shared_parameter_serialize( + id=id, + shared_parameter_update=shared_parameter_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UuidResponse", + '400': None, + '401': None, + '403': None, + '404': None, + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_shared_parameter_serialize( + self, + id, + shared_parameter_update, + _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, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = 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 shared_parameter_update is not None: + _body_params = shared_parameter_update + + + # set the HTTP header `Accept` + _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] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/shared_parameter/{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/qase-api-client/src/qase/api_client_v1/models/__init__.py b/qase-api-client/src/qase/api_client_v1/models/__init__.py index b75fe850..79a187d5 100644 --- a/qase-api-client/src/qase/api_client_v1/models/__init__.py +++ b/qase-api-client/src/qase/api_client_v1/models/__init__.py @@ -71,6 +71,9 @@ from qase.api_client_v1.models.milestone_list_response_all_of_result import MilestoneListResponseAllOfResult from qase.api_client_v1.models.milestone_response import MilestoneResponse from qase.api_client_v1.models.milestone_update import MilestoneUpdate +from qase.api_client_v1.models.parameter_group import ParameterGroup +from qase.api_client_v1.models.parameter_shared import ParameterShared +from qase.api_client_v1.models.parameter_single import ParameterSingle from qase.api_client_v1.models.plan import Plan from qase.api_client_v1.models.plan_create import PlanCreate from qase.api_client_v1.models.plan_detailed import PlanDetailed @@ -94,6 +97,7 @@ from qase.api_client_v1.models.qql_defect import QqlDefect from qase.api_client_v1.models.qql_plan import QqlPlan from qase.api_client_v1.models.qql_test_case import QqlTestCase +from qase.api_client_v1.models.qql_test_case_params import QqlTestCaseParams from qase.api_client_v1.models.requirement import Requirement from qase.api_client_v1.models.requirement_query import RequirementQuery from qase.api_client_v1.models.response import Response @@ -129,6 +133,13 @@ from qase.api_client_v1.models.search_response import SearchResponse from qase.api_client_v1.models.search_response_all_of_result import SearchResponseAllOfResult from qase.api_client_v1.models.search_response_all_of_result_entities import SearchResponseAllOfResultEntities +from qase.api_client_v1.models.shared_parameter import SharedParameter +from qase.api_client_v1.models.shared_parameter_create import SharedParameterCreate +from qase.api_client_v1.models.shared_parameter_list_response import SharedParameterListResponse +from qase.api_client_v1.models.shared_parameter_list_response_all_of_result import SharedParameterListResponseAllOfResult +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter +from qase.api_client_v1.models.shared_parameter_response import SharedParameterResponse +from qase.api_client_v1.models.shared_parameter_update import SharedParameterUpdate from qase.api_client_v1.models.shared_step import SharedStep from qase.api_client_v1.models.shared_step_content import SharedStepContent from qase.api_client_v1.models.shared_step_content_create import SharedStepContentCreate @@ -154,6 +165,11 @@ from qase.api_client_v1.models.test_case_external_issues_links_inner import TestCaseExternalIssuesLinksInner from qase.api_client_v1.models.test_case_list_response import TestCaseListResponse from qase.api_client_v1.models.test_case_list_response_all_of_result import TestCaseListResponseAllOfResult +from qase.api_client_v1.models.test_case_parameter import TestCaseParameter +from qase.api_client_v1.models.test_case_parameter_base import TestCaseParameterBase +from qase.api_client_v1.models.test_case_parameter_group import TestCaseParameterGroup +from qase.api_client_v1.models.test_case_parameter_single import TestCaseParameterSingle +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate from qase.api_client_v1.models.test_case_params import TestCaseParams from qase.api_client_v1.models.test_case_query import TestCaseQuery from qase.api_client_v1.models.test_case_response import TestCaseResponse @@ -165,3 +181,5 @@ from qase.api_client_v1.models.test_step_create import TestStepCreate from qase.api_client_v1.models.test_step_result import TestStepResult from qase.api_client_v1.models.test_step_result_create import TestStepResultCreate +from qase.api_client_v1.models.uuid_response import UuidResponse +from qase.api_client_v1.models.uuid_response_all_of_result import UuidResponseAllOfResult diff --git a/qase-api-client/src/qase/api_client_v1/models/parameter_group.py b/qase-api-client/src/qase/api_client_v1/models/parameter_group.py new file mode 100644 index 00000000..3bfde349 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/parameter_group.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from qase.api_client_v1.models.parameter_single import ParameterSingle +from typing import Optional, Set +from typing_extensions import Self + +class ParameterGroup(BaseModel): + """ + Group parameter + """ # noqa: E501 + items: Annotated[List[ParameterSingle], Field(min_length=2)] + __properties: ClassVar[List[str]] = ["items"] + + 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) -> Optional[Self]: + """Create an instance of ParameterGroup 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 items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ParameterSingle.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/parameter_shared.py b/qase-api-client/src/qase/api_client_v1/models/parameter_shared.py new file mode 100644 index 00000000..aa6dc3e1 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/parameter_shared.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ParameterShared(BaseModel): + """ + Shared parameter + """ # noqa: E501 + shared_id: StrictStr + __properties: ClassVar[List[str]] = ["shared_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) -> Optional[Self]: + """Create an instance of ParameterShared 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterShared from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shared_id": obj.get("shared_id") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/parameter_single.py b/qase-api-client/src/qase/api_client_v1/models/parameter_single.py new file mode 100644 index 00000000..50b382c0 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/parameter_single.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ParameterSingle(BaseModel): + """ + Single parameter + """ # noqa: E501 + title: StrictStr + values: List[StrictStr] + __properties: ClassVar[List[str]] = ["title", "values"] + + 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) -> Optional[Self]: + """Create an instance of ParameterSingle 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ParameterSingle from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "values": obj.get("values") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/qql_test_case.py b/qase-api-client/src/qase/api_client_v1/models/qql_test_case.py index 3113a011..ae184466 100644 --- a/qase-api-client/src/qase/api_client_v1/models/qql_test_case.py +++ b/qase-api-client/src/qase/api_client_v1/models/qql_test_case.py @@ -23,8 +23,8 @@ from typing import Any, ClassVar, Dict, List, Optional from qase.api_client_v1.models.attachment import Attachment from qase.api_client_v1.models.custom_field_value import CustomFieldValue +from qase.api_client_v1.models.qql_test_case_params import QqlTestCaseParams from qase.api_client_v1.models.tag_value import TagValue -from qase.api_client_v1.models.test_case_params import TestCaseParams from qase.api_client_v1.models.test_step import TestStep from typing import Optional, Set from typing_extensions import Self @@ -54,7 +54,7 @@ class QqlTestCase(BaseModel): attachments: Optional[List[Attachment]] = None steps_type: Optional[StrictStr] = None steps: Optional[List[TestStep]] = None - params: Optional[TestCaseParams] = None + params: Optional[QqlTestCaseParams] = None tags: Optional[List[TagValue]] = None member_id: Optional[StrictInt] = Field(default=None, description="Deprecated, use `author_id` instead.") author_id: Optional[StrictInt] = None @@ -196,7 +196,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "attachments": [Attachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "steps_type": obj.get("steps_type"), "steps": [TestStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, - "params": TestCaseParams.from_dict(obj["params"]) if obj.get("params") is not None else None, + "params": QqlTestCaseParams.from_dict(obj["params"]) if obj.get("params") is not None else None, "tags": [TagValue.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, "member_id": obj.get("member_id"), "author_id": obj.get("author_id"), diff --git a/qase-api-client/src/qase/api_client_v1/models/qql_test_case_params.py b/qase-api-client/src/qase/api_client_v1/models/qql_test_case_params.py new file mode 100644 index 00000000..d469b0f2 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/qql_test_case_params.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +import re # noqa: F401 +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, List, Optional +from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +QQLTESTCASEPARAMS_ANY_OF_SCHEMAS = ["List[object]", "object"] + +class QqlTestCaseParams(BaseModel): + """ + QqlTestCaseParams + """ + + # data type: List[object] + anyof_schema_1_validator: Optional[List[Dict[str, Any]]] = None + # data type: object + anyof_schema_2_validator: Optional[Dict[str, Any]] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[List[object], object]] = None + else: + actual_instance: Any = None + any_of_schemas: List[str] = Field(default=Literal["List[object]", "object"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = QqlTestCaseParams.model_construct() + error_messages = [] + # validate data type: List[object] + try: + instance.anyof_schema_1_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.anyof_schema_2_validator = v + return v + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in QqlTestCaseParams with anyOf schemas: List[object], object. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # deserialize data into List[object] + try: + # validation + instance.anyof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_1_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.anyof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.anyof_schema_2_validator + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into QqlTestCaseParams with anyOf schemas: List[object], object. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[object], object]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter.py new file mode 100644 index 00000000..51e5eb09 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameter(BaseModel): + """ + SharedParameter + """ # noqa: E501 + id: StrictStr + title: Annotated[str, Field(strict=True, max_length=255)] + type: StrictStr + project_codes: List[StrictStr] + is_enabled_for_all_projects: StrictBool + parameters: SharedParameterParameter + __properties: ClassVar[List[str]] = ["id", "title", "type", "project_codes", "is_enabled_for_all_projects", "parameters"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['single', 'group']): + raise ValueError("must be one of enum values ('single', 'group')") + 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) -> Optional[Self]: + """Create an instance of SharedParameter 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameter 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"), + "type": obj.get("type"), + "project_codes": obj.get("project_codes"), + "is_enabled_for_all_projects": obj.get("is_enabled_for_all_projects"), + "parameters": SharedParameterParameter.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_create.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_create.py new file mode 100644 index 00000000..bec52f91 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_create.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameterCreate(BaseModel): + """ + SharedParameterCreate + """ # noqa: E501 + title: Annotated[str, Field(strict=True, max_length=255)] + type: StrictStr + project_codes: Optional[List[StrictStr]] = Field(default=None, description="List of project codes to associate with this shared parameter") + is_enabled_for_all_projects: StrictBool + parameters: SharedParameterParameter + __properties: ClassVar[List[str]] = ["title", "type", "project_codes", "is_enabled_for_all_projects", "parameters"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['single', 'group']): + raise ValueError("must be one of enum values ('single', 'group')") + 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) -> Optional[Self]: + """Create an instance of SharedParameterCreate 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameterCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "type": obj.get("type"), + "project_codes": obj.get("project_codes"), + "is_enabled_for_all_projects": obj.get("is_enabled_for_all_projects"), + "parameters": SharedParameterParameter.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response.py new file mode 100644 index 00000000..3620ada7 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from qase.api_client_v1.models.shared_parameter_list_response_all_of_result import SharedParameterListResponseAllOfResult +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameterListResponse(BaseModel): + """ + SharedParameterListResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[SharedParameterListResponseAllOfResult] = None + __properties: ClassVar[List[str]] = ["status", "result"] + + 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) -> Optional[Self]: + """Create an instance of SharedParameterListResponse 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 result + if self.result: + _dict['result'] = self.result.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameterListResponse 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"), + "result": SharedParameterListResponseAllOfResult.from_dict(obj["result"]) if obj.get("result") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response_all_of_result.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response_all_of_result.py new file mode 100644 index 00000000..d6db0a82 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_list_response_all_of_result.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from qase.api_client_v1.models.shared_parameter import SharedParameter +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameterListResponseAllOfResult(BaseModel): + """ + SharedParameterListResponseAllOfResult + """ # noqa: E501 + total: StrictInt + entities: List[SharedParameter] + __properties: ClassVar[List[str]] = ["total", "entities"] + + 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) -> Optional[Self]: + """Create an instance of SharedParameterListResponseAllOfResult 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 entities (list) + _items = [] + if self.entities: + for _item in self.entities: + if _item: + _items.append(_item.to_dict()) + _dict['entities'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameterListResponseAllOfResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "entities": [SharedParameter.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_parameter.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_parameter.py new file mode 100644 index 00000000..79ffd3d3 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_parameter.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.parameter_single import ParameterSingle +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +SHAREDPARAMETERPARAMETER_ONE_OF_SCHEMAS = ["List[ParameterSingle]"] + +class SharedParameterParameter(BaseModel): + """ + SharedParameterParameter + """ + # data type: List[ParameterSingle] + oneof_schema_1_validator: Optional[Annotated[List[ParameterSingle], Field(min_length=1, max_length=1)]] = Field(default=None, description="Single parameter") + # data type: List[ParameterSingle] + oneof_schema_2_validator: Optional[Annotated[List[ParameterSingle], Field(min_length=2)]] = Field(default=None, description="Group parameter") + actual_instance: Optional[Union[List[ParameterSingle]]] = None + one_of_schemas: List[str] = Field(default=Literal["List[ParameterSingle]"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = SharedParameterParameter.model_construct() + error_messages = [] + match = 0 + # validate data type: List[ParameterSingle] + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: List[ParameterSingle] + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in SharedParameterParameter with oneOf schemas: List[ParameterSingle]. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in SharedParameterParameter with oneOf schemas: List[ParameterSingle]. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into List[ParameterSingle] + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[ParameterSingle] + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into SharedParameterParameter with oneOf schemas: List[ParameterSingle]. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into SharedParameterParameter with oneOf schemas: List[ParameterSingle]. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[ParameterSingle]]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_response.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_response.py new file mode 100644 index 00000000..d858b1b5 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from qase.api_client_v1.models.shared_parameter import SharedParameter +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameterResponse(BaseModel): + """ + SharedParameterResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[SharedParameter] = None + __properties: ClassVar[List[str]] = ["status", "result"] + + 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) -> Optional[Self]: + """Create an instance of SharedParameterResponse 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 result + if self.result: + _dict['result'] = self.result.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameterResponse 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"), + "result": SharedParameter.from_dict(obj["result"]) if obj.get("result") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/shared_parameter_update.py b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_update.py new file mode 100644 index 00000000..33555b17 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/shared_parameter_update.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.shared_parameter_parameter import SharedParameterParameter +from typing import Optional, Set +from typing_extensions import Self + +class SharedParameterUpdate(BaseModel): + """ + SharedParameterUpdate + """ # noqa: E501 + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + project_codes: Optional[List[StrictStr]] = Field(default=None, description="List of project codes to associate with this shared parameter") + is_enabled_for_all_projects: Optional[StrictBool] = None + parameters: Optional[SharedParameterParameter] = None + __properties: ClassVar[List[str]] = ["title", "project_codes", "is_enabled_for_all_projects", "parameters"] + + 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) -> Optional[Self]: + """Create an instance of SharedParameterUpdate 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SharedParameterUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "project_codes": obj.get("project_codes"), + "is_enabled_for_all_projects": obj.get("is_enabled_for_all_projects"), + "parameters": SharedParameterParameter.from_dict(obj["parameters"]) if obj.get("parameters") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case.py b/qase-api-client/src/qase/api_client_v1/models/test_case.py index 110ecb2f..bd24d3a8 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_case.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_case.py @@ -25,6 +25,7 @@ from qase.api_client_v1.models.custom_field_value import CustomFieldValue from qase.api_client_v1.models.external_issue import ExternalIssue from qase.api_client_v1.models.tag_value import TagValue +from qase.api_client_v1.models.test_case_parameter import TestCaseParameter from qase.api_client_v1.models.test_case_params import TestCaseParams from qase.api_client_v1.models.test_step import TestStep from typing import Optional, Set @@ -55,6 +56,7 @@ class TestCase(BaseModel): steps_type: Optional[StrictStr] = None steps: Optional[List[TestStep]] = None params: Optional[TestCaseParams] = None + parameters: Optional[List[TestCaseParameter]] = None tags: Optional[List[TagValue]] = None member_id: Optional[StrictInt] = Field(default=None, description="Deprecated, use `author_id` instead.") author_id: Optional[StrictInt] = None @@ -64,7 +66,7 @@ class TestCase(BaseModel): created: Optional[StrictStr] = Field(default=None, description="Deprecated, use the `created_at` property instead.") updated: Optional[StrictStr] = Field(default=None, description="Deprecated, use the `updated_at` property instead.") external_issues: Optional[List[ExternalIssue]] = None - __properties: ClassVar[List[str]] = ["id", "position", "title", "description", "preconditions", "postconditions", "severity", "priority", "type", "layer", "is_flaky", "behavior", "automation", "status", "milestone_id", "suite_id", "custom_fields", "attachments", "steps_type", "steps", "params", "tags", "member_id", "author_id", "created_at", "updated_at", "deleted", "created", "updated", "external_issues"] + __properties: ClassVar[List[str]] = ["id", "position", "title", "description", "preconditions", "postconditions", "severity", "priority", "type", "layer", "is_flaky", "behavior", "automation", "status", "milestone_id", "suite_id", "custom_fields", "attachments", "steps_type", "steps", "params", "parameters", "tags", "member_id", "author_id", "created_at", "updated_at", "deleted", "created", "updated", "external_issues"] model_config = ConfigDict( populate_by_name=True, @@ -129,6 +131,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of params if self.params: _dict['params'] = self.params.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item in self.parameters: + if _item: + _items.append(_item.to_dict()) + _dict['parameters'] = _items # override the default output from pydantic by calling `to_dict()` of each item in tags (list) _items = [] if self.tags: @@ -211,6 +220,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "steps_type": obj.get("steps_type"), "steps": [TestStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, "params": TestCaseParams.from_dict(obj["params"]) if obj.get("params") is not None else None, + "parameters": [TestCaseParameter.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, "tags": [TagValue.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, "member_id": obj.get("member_id"), "author_id": obj.get("author_id"), diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_create.py b/qase-api-client/src/qase/api_client_v1/models/test_case_create.py index 9a9229c0..ebd59ee6 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_case_create.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_create.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate from qase.api_client_v1.models.test_step_create import TestStepCreate from typing import Optional, Set from typing_extensions import Self @@ -46,11 +47,12 @@ class TestCaseCreate(BaseModel): attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") steps: Optional[List[TestStepCreate]] = None tags: Optional[List[StrictStr]] = None - params: Optional[Dict[str, List[StrictStr]]] = None + params: Optional[Dict[str, List[StrictStr]]] = Field(default=None, description="Deprecated, use `parameters` instead.") + parameters: Optional[List[TestCaseParametercreate]] = None custom_field: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of custom fields values (id => value)") created_at: Optional[StrictStr] = None updated_at: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "custom_field", "created_at", "updated_at"] + __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "parameters", "custom_field", "created_at", "updated_at"] model_config = ConfigDict( populate_by_name=True, @@ -98,11 +100,23 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['steps'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item in self.parameters: + if _item: + _items.append(_item.to_dict()) + _dict['parameters'] = _items # set to None if params (nullable) is None # and model_fields_set contains the field if self.params is None and "params" in self.model_fields_set: _dict['params'] = None + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + return _dict @classmethod @@ -133,6 +147,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "steps": [TestStepCreate.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, "tags": obj.get("tags"), "params": obj.get("params"), + "parameters": [TestCaseParametercreate.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, "custom_field": obj.get("custom_field"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at") diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_parameter.py b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter.py new file mode 100644 index 00000000..f6faaca5 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from qase.api_client_v1.models.test_case_parameter_group import TestCaseParameterGroup +from qase.api_client_v1.models.test_case_parameter_single import TestCaseParameterSingle +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +TESTCASEPARAMETER_ONE_OF_SCHEMAS = ["TestCaseParameterGroup", "TestCaseParameterSingle"] + +class TestCaseParameter(BaseModel): + """ + TestCaseParameter + """ + # data type: TestCaseParameterSingle + oneof_schema_1_validator: Optional[TestCaseParameterSingle] = None + # data type: TestCaseParameterGroup + oneof_schema_2_validator: Optional[TestCaseParameterGroup] = None + actual_instance: Optional[Union[TestCaseParameterGroup, TestCaseParameterSingle]] = None + one_of_schemas: List[str] = Field(default=Literal["TestCaseParameterGroup", "TestCaseParameterSingle"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = TestCaseParameter.model_construct() + error_messages = [] + match = 0 + # validate data type: TestCaseParameterSingle + if not isinstance(v, TestCaseParameterSingle): + error_messages.append(f"Error! Input type `{type(v)}` is not `TestCaseParameterSingle`") + else: + match += 1 + # validate data type: TestCaseParameterGroup + if not isinstance(v, TestCaseParameterGroup): + error_messages.append(f"Error! Input type `{type(v)}` is not `TestCaseParameterGroup`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in TestCaseParameter with oneOf schemas: TestCaseParameterGroup, TestCaseParameterSingle. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in TestCaseParameter with oneOf schemas: TestCaseParameterGroup, TestCaseParameterSingle. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into TestCaseParameterSingle + try: + instance.actual_instance = TestCaseParameterSingle.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TestCaseParameterGroup + try: + instance.actual_instance = TestCaseParameterGroup.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into TestCaseParameter with oneOf schemas: TestCaseParameterGroup, TestCaseParameterSingle. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into TestCaseParameter with oneOf schemas: TestCaseParameterGroup, TestCaseParameterSingle. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], TestCaseParameterGroup, TestCaseParameterSingle]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_base.py b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_base.py new file mode 100644 index 00000000..e1ac6df9 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_base.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from qase.api_client_v1.models.parameter_single import ParameterSingle +from typing import Optional, Set +from typing_extensions import Self + +class TestCaseParameterBase(BaseModel): + """ + TestCaseParameterBase + """ # noqa: E501 + shared_id: Optional[StrictStr] = None + type: StrictStr + items: List[ParameterSingle] + __properties: ClassVar[List[str]] = ["shared_id", "type", "items"] + + 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) -> Optional[Self]: + """Create an instance of TestCaseParameterBase 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 items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict['items'] = _items + # set to None if shared_id (nullable) is None + # and model_fields_set contains the field + if self.shared_id is None and "shared_id" in self.model_fields_set: + _dict['shared_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestCaseParameterBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shared_id": obj.get("shared_id"), + "type": obj.get("type"), + "items": [ParameterSingle.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_group.py b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_group.py new file mode 100644 index 00000000..3545d5a8 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_group.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestCaseParameterGroup(BaseModel): + """ + TestCaseParameterGroup + """ # noqa: E501 + shared_id: Optional[StrictStr] = None + type: StrictStr + items: Dict[str, Any] + __properties: ClassVar[List[str]] = ["shared_id", "type", "items"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['group']): + raise ValueError("must be one of enum values ('group')") + 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) -> Optional[Self]: + """Create an instance of TestCaseParameterGroup 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 shared_id (nullable) is None + # and model_fields_set contains the field + if self.shared_id is None and "shared_id" in self.model_fields_set: + _dict['shared_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestCaseParameterGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shared_id": obj.get("shared_id"), + "type": obj.get("type"), + "items": obj.get("items") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_single.py b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_single.py new file mode 100644 index 00000000..ead72703 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_parameter_single.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TestCaseParameterSingle(BaseModel): + """ + TestCaseParameterSingle + """ # noqa: E501 + shared_id: Optional[StrictStr] = None + type: StrictStr + items: Dict[str, Any] + __properties: ClassVar[List[str]] = ["shared_id", "type", "items"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['single']): + raise ValueError("must be one of enum values ('single')") + 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) -> Optional[Self]: + """Create an instance of TestCaseParameterSingle 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 shared_id (nullable) is None + # and model_fields_set contains the field + if self.shared_id is None and "shared_id" in self.model_fields_set: + _dict['shared_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestCaseParameterSingle from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shared_id": obj.get("shared_id"), + "type": obj.get("type"), + "items": obj.get("items") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_parametercreate.py b/qase-api-client/src/qase/api_client_v1/models/test_case_parametercreate.py new file mode 100644 index 00000000..a08698ca --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_parametercreate.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from qase.api_client_v1.models.parameter_group import ParameterGroup +from qase.api_client_v1.models.parameter_shared import ParameterShared +from qase.api_client_v1.models.parameter_single import ParameterSingle +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +TESTCASEPARAMETERCREATE_ONE_OF_SCHEMAS = ["ParameterGroup", "ParameterShared", "ParameterSingle"] + +class TestCaseParametercreate(BaseModel): + """ + TestCaseParametercreate + """ + # data type: ParameterShared + oneof_schema_1_validator: Optional[ParameterShared] = None + # data type: ParameterSingle + oneof_schema_2_validator: Optional[ParameterSingle] = None + # data type: ParameterGroup + oneof_schema_3_validator: Optional[ParameterGroup] = None + actual_instance: Optional[Union[ParameterGroup, ParameterShared, ParameterSingle]] = None + one_of_schemas: List[str] = Field(default=Literal["ParameterGroup", "ParameterShared", "ParameterSingle"]) + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = TestCaseParametercreate.model_construct() + error_messages = [] + match = 0 + # validate data type: ParameterShared + if not isinstance(v, ParameterShared): + error_messages.append(f"Error! Input type `{type(v)}` is not `ParameterShared`") + else: + match += 1 + # validate data type: ParameterSingle + if not isinstance(v, ParameterSingle): + error_messages.append(f"Error! Input type `{type(v)}` is not `ParameterSingle`") + else: + match += 1 + # validate data type: ParameterGroup + if not isinstance(v, ParameterGroup): + error_messages.append(f"Error! Input type `{type(v)}` is not `ParameterGroup`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in TestCaseParametercreate with oneOf schemas: ParameterGroup, ParameterShared, ParameterSingle. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in TestCaseParametercreate with oneOf schemas: ParameterGroup, ParameterShared, ParameterSingle. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into ParameterShared + try: + instance.actual_instance = ParameterShared.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ParameterSingle + try: + instance.actual_instance = ParameterSingle.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ParameterGroup + try: + instance.actual_instance = ParameterGroup.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into TestCaseParametercreate with oneOf schemas: ParameterGroup, ParameterShared, ParameterSingle. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into TestCaseParametercreate with oneOf schemas: ParameterGroup, ParameterShared, ParameterSingle. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ParameterGroup, ParameterShared, ParameterSingle]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_params.py b/qase-api-client/src/qase/api_client_v1/models/test_case_params.py index 1bf121f1..8bf05d38 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_case_params.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_params.py @@ -28,7 +28,7 @@ class TestCaseParams(BaseModel): """ - TestCaseParams + Deprecated, use `parameters` instead. """ # data type: List[object] diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_query.py b/qase-api-client/src/qase/api_client_v1/models/test_case_query.py index b3716163..c84847f4 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_case_query.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_query.py @@ -23,8 +23,8 @@ from typing import Any, ClassVar, Dict, List, Optional from qase.api_client_v1.models.attachment import Attachment from qase.api_client_v1.models.custom_field_value import CustomFieldValue +from qase.api_client_v1.models.qql_test_case_params import QqlTestCaseParams from qase.api_client_v1.models.tag_value import TagValue -from qase.api_client_v1.models.test_case_params import TestCaseParams from qase.api_client_v1.models.test_step import TestStep from typing import Optional, Set from typing_extensions import Self @@ -54,7 +54,7 @@ class TestCaseQuery(BaseModel): attachments: Optional[List[Attachment]] = None steps_type: Optional[StrictStr] = None steps: Optional[List[TestStep]] = None - params: Optional[TestCaseParams] = None + params: Optional[QqlTestCaseParams] = None tags: Optional[List[TagValue]] = None member_id: Optional[StrictInt] = Field(default=None, description="Deprecated, use `author_id` instead.") author_id: Optional[StrictInt] = None @@ -196,7 +196,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "attachments": [Attachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "steps_type": obj.get("steps_type"), "steps": [TestStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, - "params": TestCaseParams.from_dict(obj["params"]) if obj.get("params") is not None else None, + "params": QqlTestCaseParams.from_dict(obj["params"]) if obj.get("params") is not None else None, "tags": [TagValue.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, "member_id": obj.get("member_id"), "author_id": obj.get("author_id"), diff --git a/qase-api-client/src/qase/api_client_v1/models/test_case_update.py b/qase-api-client/src/qase/api_client_v1/models/test_case_update.py index 1e22ca01..9a96db70 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_case_update.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_case_update.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate from qase.api_client_v1.models.test_step_create import TestStepCreate from typing import Optional, Set from typing_extensions import Self @@ -46,9 +47,10 @@ class TestCaseUpdate(BaseModel): attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") steps: Optional[List[TestStepCreate]] = None tags: Optional[List[StrictStr]] = None - params: Optional[Dict[str, List[StrictStr]]] = None + params: Optional[Dict[str, List[StrictStr]]] = Field(default=None, description="Deprecated, use `parameters` instead.") + parameters: Optional[List[TestCaseParametercreate]] = None custom_field: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of custom fields values (id => value)") - __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "custom_field"] + __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "parameters", "custom_field"] model_config = ConfigDict( populate_by_name=True, @@ -96,11 +98,23 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['steps'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item in self.parameters: + if _item: + _items.append(_item.to_dict()) + _dict['parameters'] = _items # set to None if params (nullable) is None # and model_fields_set contains the field if self.params is None and "params" in self.model_fields_set: _dict['params'] = None + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + return _dict @classmethod @@ -131,6 +145,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "steps": [TestStepCreate.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, "tags": obj.get("tags"), "params": obj.get("params"), + "parameters": [TestCaseParametercreate.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, "custom_field": obj.get("custom_field") }) return _obj diff --git a/qase-api-client/src/qase/api_client_v1/models/test_casebulk_cases_inner.py b/qase-api-client/src/qase/api_client_v1/models/test_casebulk_cases_inner.py index 37481fe8..7dc2fd6f 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_casebulk_cases_inner.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_casebulk_cases_inner.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from qase.api_client_v1.models.test_case_parametercreate import TestCaseParametercreate from qase.api_client_v1.models.test_step_create import TestStepCreate from typing import Optional, Set from typing_extensions import Self @@ -46,12 +47,13 @@ class TestCasebulkCasesInner(BaseModel): attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") steps: Optional[List[TestStepCreate]] = None tags: Optional[List[StrictStr]] = None - params: Optional[Dict[str, List[StrictStr]]] = None + params: Optional[Dict[str, List[StrictStr]]] = Field(default=None, description="Deprecated, use `parameters` instead.") + parameters: Optional[List[TestCaseParametercreate]] = None custom_field: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of custom fields values (id => value)") created_at: Optional[StrictStr] = None updated_at: Optional[StrictStr] = None id: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "custom_field", "created_at", "updated_at", "id"] + __properties: ClassVar[List[str]] = ["description", "preconditions", "postconditions", "title", "severity", "priority", "behavior", "type", "layer", "is_flaky", "suite_id", "milestone_id", "automation", "status", "attachments", "steps", "tags", "params", "parameters", "custom_field", "created_at", "updated_at", "id"] model_config = ConfigDict( populate_by_name=True, @@ -99,11 +101,23 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['steps'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in parameters (list) + _items = [] + if self.parameters: + for _item in self.parameters: + if _item: + _items.append(_item.to_dict()) + _dict['parameters'] = _items # set to None if params (nullable) is None # and model_fields_set contains the field if self.params is None and "params" in self.model_fields_set: _dict['params'] = None + # set to None if parameters (nullable) is None + # and model_fields_set contains the field + if self.parameters is None and "parameters" in self.model_fields_set: + _dict['parameters'] = None + # set to None if id (nullable) is None # and model_fields_set contains the field if self.id is None and "id" in self.model_fields_set: @@ -139,6 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "steps": [TestStepCreate.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, "tags": obj.get("tags"), "params": obj.get("params"), + "parameters": [TestCaseParametercreate.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, "custom_field": obj.get("custom_field"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/qase-api-client/src/qase/api_client_v1/models/uuid_response.py b/qase-api-client/src/qase/api_client_v1/models/uuid_response.py new file mode 100644 index 00000000..82ba53d2 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/uuid_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from qase.api_client_v1.models.uuid_response_all_of_result import UuidResponseAllOfResult +from typing import Optional, Set +from typing_extensions import Self + +class UuidResponse(BaseModel): + """ + UuidResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[UuidResponseAllOfResult] = None + __properties: ClassVar[List[str]] = ["status", "result"] + + 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) -> Optional[Self]: + """Create an instance of UuidResponse 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 result + if self.result: + _dict['result'] = self.result.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UuidResponse 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"), + "result": UuidResponseAllOfResult.from_dict(obj["result"]) if obj.get("result") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/uuid_response_all_of_result.py b/qase-api-client/src/qase/api_client_v1/models/uuid_response_all_of_result.py new file mode 100644 index 00000000..9851e339 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/uuid_response_all_of_result.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Qase.io TestOps API v1 + + Qase TestOps API v1 Specification. + + The version of the OpenAPI document: 1.0.0 + Contact: support@qase.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UuidResponseAllOfResult(BaseModel): + """ + UuidResponseAllOfResult + """ # noqa: E501 + id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["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) -> Optional[Self]: + """Create an instance of UuidResponseAllOfResult 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: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UuidResponseAllOfResult 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") + }) + return _obj + +