From fee45c643b6da65889c521d2c8e6e6405bc01309 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Fri, 14 Aug 2026 15:57:32 +0300 Subject: [PATCH] chore: update API clients to latest specification --- qase-api-client/docs/Author.md | 3 +- qase-api-client/docs/AuthorsApi.md | 4 +- qase-api-client/docs/Review.md | 37 + qase-api-client/docs/ReviewBulk.md | 29 + qase-api-client/docs/ReviewBulkResponse.md | 30 + .../docs/ReviewBulkResponseAllOfResult.md | 29 + .../ReviewBulkResponseAllOfResultItems.md | 31 + qase-api-client/docs/ReviewCaseData.md | 51 + qase-api-client/docs/ReviewCreate.md | 31 + qase-api-client/docs/ReviewDetailed.md | 38 + qase-api-client/docs/ReviewListResponse.md | 30 + .../docs/ReviewListResponseAllOfResult.md | 32 + qase-api-client/docs/ReviewProposedCase.md | 51 + qase-api-client/docs/ReviewProposedStep.md | 35 + qase-api-client/docs/ReviewResponse.md | 30 + qase-api-client/docs/ReviewReviewersInner.md | 30 + qase-api-client/docs/ReviewStepData.md | 36 + qase-api-client/docs/ReviewUpdate.md | 30 + qase-api-client/docs/ReviewsApi.md | 576 +++++ qase-api-client/docs/TestStepCreate.md | 1 + qase-api-client/pyproject.toml | 2 +- .../src/qase/api_client_v1/__init__.py | 34 + .../src/qase/api_client_v1/api/__init__.py | 1 + .../src/qase/api_client_v1/api/authors_api.py | 20 +- .../src/qase/api_client_v1/api/reviews_api.py | 1997 +++++++++++++++++ .../src/qase/api_client_v1/models/__init__.py | 16 + .../src/qase/api_client_v1/models/author.py | 9 +- .../src/qase/api_client_v1/models/review.py | 149 ++ .../qase/api_client_v1/models/review_bulk.py | 97 + .../models/review_bulk_response.py | 94 + .../review_bulk_response_all_of_result.py | 96 + ...eview_bulk_response_all_of_result_items.py | 107 + .../api_client_v1/models/review_case_data.py | 227 ++ .../api_client_v1/models/review_create.py | 103 + .../api_client_v1/models/review_detailed.py | 156 ++ .../models/review_list_response.py | 94 + .../review_list_response_all_of_result.py | 102 + .../models/review_proposed_case.py | 230 ++ .../models/review_proposed_step.py | 100 + .../api_client_v1/models/review_response.py | 94 + .../models/review_reviewers_inner.py | 106 + .../api_client_v1/models/review_step_data.py | 100 + .../api_client_v1/models/review_update.py | 96 + .../api_client_v1/models/test_step_create.py | 2 +- 44 files changed, 5148 insertions(+), 18 deletions(-) create mode 100644 qase-api-client/docs/Review.md create mode 100644 qase-api-client/docs/ReviewBulk.md create mode 100644 qase-api-client/docs/ReviewBulkResponse.md create mode 100644 qase-api-client/docs/ReviewBulkResponseAllOfResult.md create mode 100644 qase-api-client/docs/ReviewBulkResponseAllOfResultItems.md create mode 100644 qase-api-client/docs/ReviewCaseData.md create mode 100644 qase-api-client/docs/ReviewCreate.md create mode 100644 qase-api-client/docs/ReviewDetailed.md create mode 100644 qase-api-client/docs/ReviewListResponse.md create mode 100644 qase-api-client/docs/ReviewListResponseAllOfResult.md create mode 100644 qase-api-client/docs/ReviewProposedCase.md create mode 100644 qase-api-client/docs/ReviewProposedStep.md create mode 100644 qase-api-client/docs/ReviewResponse.md create mode 100644 qase-api-client/docs/ReviewReviewersInner.md create mode 100644 qase-api-client/docs/ReviewStepData.md create mode 100644 qase-api-client/docs/ReviewUpdate.md create mode 100644 qase-api-client/docs/ReviewsApi.md create mode 100644 qase-api-client/src/qase/api_client_v1/api/reviews_api.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_bulk.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_bulk_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result_items.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_case_data.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_create.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_detailed.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_list_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_list_response_all_of_result.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_proposed_case.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_proposed_step.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_response.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_reviewers_inner.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_step_data.py create mode 100644 qase-api-client/src/qase/api_client_v1/models/review_update.py diff --git a/qase-api-client/docs/Author.md b/qase-api-client/docs/Author.md index 8e343a09..f4571aea 100644 --- a/qase-api-client/docs/Author.md +++ b/qase-api-client/docs/Author.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**author_id** | **int** | | [optional] +**uuid** | **UUID** | Author UUID. Use it to reference the author in other API methods. | [optional] +**author_id** | **int** | Deprecated, use `uuid` instead. | [optional] **entity_type** | **str** | | [optional] **entity_id** | **int** | | [optional] **email** | **str** | | [optional] diff --git a/qase-api-client/docs/AuthorsApi.md b/qase-api-client/docs/AuthorsApi.md index edd699d4..9f081db7 100644 --- a/qase-api-client/docs/AuthorsApi.md +++ b/qase-api-client/docs/AuthorsApi.md @@ -47,7 +47,7 @@ configuration.api_key['TokenAuth'] = os.environ["API_KEY"] with qase.api_client_v1.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = qase.api_client_v1.AuthorsApi(api_client) - id = 56 # int | Identifier. + id = 'id_example' # str | Author UUID, or the deprecated integer author ID. try: # Get a specific author @@ -65,7 +65,7 @@ with qase.api_client_v1.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **int**| Identifier. | + **id** | **str**| Author UUID, or the deprecated integer author ID. | ### Return type diff --git a/qase-api-client/docs/Review.md b/qase-api-client/docs/Review.md new file mode 100644 index 00000000..6df5a77d --- /dev/null +++ b/qase-api-client/docs/Review.md @@ -0,0 +1,37 @@ +# Review + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Review ID, unique within the project. | [optional] +**title** | **str** | | [optional] +**type** | **str** | `create` — the review proposes a new test case; `edit` — the review proposes changes to an existing test case. | [optional] +**status** | **str** | | [optional] +**case_id** | **int** | ID of the reviewed test case. Null for new-case draft reviews. | [optional] +**author_uuid** | **UUID** | Author UUID of the review creator (see `GET /author`). | [optional] +**reviewers** | [**List[ReviewReviewersInner]**](ReviewReviewersInner.md) | | [optional] +**created_at** | **datetime** | | [optional] +**updated_at** | **datetime** | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review import Review + +# TODO update the JSON string below +json = "{}" +# create an instance of Review from a JSON string +review_instance = Review.from_json(json) +# print the JSON string representation of the object +print(Review.to_json()) + +# convert the object into a dict +review_dict = review_instance.to_dict() +# create an instance of Review from a dict +review_from_dict = Review.from_dict(review_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/ReviewBulk.md b/qase-api-client/docs/ReviewBulk.md new file mode 100644 index 00000000..048e739a --- /dev/null +++ b/qase-api-client/docs/ReviewBulk.md @@ -0,0 +1,29 @@ +# ReviewBulk + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviews** | [**List[ReviewCreate]**](ReviewCreate.md) | Validated as a whole: if any item is invalid nothing is created. Otherwise each item is processed on its own and reported in the response. | + +## Example + +```python +from qase.api_client_v1.models.review_bulk import ReviewBulk + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewBulk from a JSON string +review_bulk_instance = ReviewBulk.from_json(json) +# print the JSON string representation of the object +print(ReviewBulk.to_json()) + +# convert the object into a dict +review_bulk_dict = review_bulk_instance.to_dict() +# create an instance of ReviewBulk from a dict +review_bulk_from_dict = ReviewBulk.from_dict(review_bulk_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/ReviewBulkResponse.md b/qase-api-client/docs/ReviewBulkResponse.md new file mode 100644 index 00000000..e695b9cf --- /dev/null +++ b/qase-api-client/docs/ReviewBulkResponse.md @@ -0,0 +1,30 @@ +# ReviewBulkResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**ReviewBulkResponseAllOfResult**](ReviewBulkResponseAllOfResult.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_bulk_response import ReviewBulkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewBulkResponse from a JSON string +review_bulk_response_instance = ReviewBulkResponse.from_json(json) +# print the JSON string representation of the object +print(ReviewBulkResponse.to_json()) + +# convert the object into a dict +review_bulk_response_dict = review_bulk_response_instance.to_dict() +# create an instance of ReviewBulkResponse from a dict +review_bulk_response_from_dict = ReviewBulkResponse.from_dict(review_bulk_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/ReviewBulkResponseAllOfResult.md b/qase-api-client/docs/ReviewBulkResponseAllOfResult.md new file mode 100644 index 00000000..9f9add89 --- /dev/null +++ b/qase-api-client/docs/ReviewBulkResponseAllOfResult.md @@ -0,0 +1,29 @@ +# ReviewBulkResponseAllOfResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List[ReviewBulkResponseAllOfResultItems]**](ReviewBulkResponseAllOfResultItems.md) | Per-item outcomes, in request order. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_bulk_response_all_of_result import ReviewBulkResponseAllOfResult + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewBulkResponseAllOfResult from a JSON string +review_bulk_response_all_of_result_instance = ReviewBulkResponseAllOfResult.from_json(json) +# print the JSON string representation of the object +print(ReviewBulkResponseAllOfResult.to_json()) + +# convert the object into a dict +review_bulk_response_all_of_result_dict = review_bulk_response_all_of_result_instance.to_dict() +# create an instance of ReviewBulkResponseAllOfResult from a dict +review_bulk_response_all_of_result_from_dict = ReviewBulkResponseAllOfResult.from_dict(review_bulk_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/ReviewBulkResponseAllOfResultItems.md b/qase-api-client/docs/ReviewBulkResponseAllOfResultItems.md new file mode 100644 index 00000000..639b6ec2 --- /dev/null +++ b/qase-api-client/docs/ReviewBulkResponseAllOfResultItems.md @@ -0,0 +1,31 @@ +# ReviewBulkResponseAllOfResultItems + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**review_id** | **int** | ID of the created review. Null when the item failed. | [optional] +**case_id** | **int** | The `case_id` submitted with the item, echoed back for correlation. Null for new-case draft reviews. | [optional] +**error** | **str** | Failure reason. Null when the item was created. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_bulk_response_all_of_result_items import ReviewBulkResponseAllOfResultItems + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewBulkResponseAllOfResultItems from a JSON string +review_bulk_response_all_of_result_items_instance = ReviewBulkResponseAllOfResultItems.from_json(json) +# print the JSON string representation of the object +print(ReviewBulkResponseAllOfResultItems.to_json()) + +# convert the object into a dict +review_bulk_response_all_of_result_items_dict = review_bulk_response_all_of_result_items_instance.to_dict() +# create an instance of ReviewBulkResponseAllOfResultItems from a dict +review_bulk_response_all_of_result_items_from_dict = ReviewBulkResponseAllOfResultItems.from_dict(review_bulk_response_all_of_result_items_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/ReviewCaseData.md b/qase-api-client/docs/ReviewCaseData.md new file mode 100644 index 00000000..b8deb0b2 --- /dev/null +++ b/qase-api-client/docs/ReviewCaseData.md @@ -0,0 +1,51 @@ +# ReviewCaseData + +The test case fields proposed by the review. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | [optional] +**description** | **str** | | [optional] +**preconditions** | **str** | | [optional] +**postconditions** | **str** | | [optional] +**severity** | **int** | | [optional] +**priority** | **int** | | [optional] +**behavior** | **int** | | [optional] +**type** | **int** | | [optional] +**layer** | **int** | | [optional] +**is_flaky** | **int** | | [optional] +**is_muted** | **bool** | Mute state of the proposed test case. | [optional] +**suite_id** | **int** | | [optional] +**milestone_id** | **int** | | [optional] +**is_manual** | **bool** | `true` if the case is manual, `false` if it is automated. | [optional] +**is_to_be_automated** | **bool** | `true` if a manual case is planned to be automated. | [optional] +**status** | **int** | | [optional] +**steps_type** | **str** | Format of the steps field. Omit to keep the current one, `classic` for a new-case draft; changing it requires sending `steps` in the same request. | [optional] +**attachments** | **List[str]** | A list of Attachment hashes. | [optional] +**steps** | [**List[ReviewStepData]**](ReviewStepData.md) | For gherkin steps send the scenario in `value`. | [optional] +**tags** | **List[str]** | | [optional] +**parameters** | [**List[TestCaseParameterCreate]**](TestCaseParameterCreate.md) | | [optional] +**custom_field** | **Dict[str, str]** | Map of custom field ID to value. A `create` review must carry every required custom field. An `edit` review is validated against the current test case, so send only the fields the proposal changes. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_case_data import ReviewCaseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewCaseData from a JSON string +review_case_data_instance = ReviewCaseData.from_json(json) +# print the JSON string representation of the object +print(ReviewCaseData.to_json()) + +# convert the object into a dict +review_case_data_dict = review_case_data_instance.to_dict() +# create an instance of ReviewCaseData from a dict +review_case_data_from_dict = ReviewCaseData.from_dict(review_case_data_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/ReviewCreate.md b/qase-api-client/docs/ReviewCreate.md new file mode 100644 index 00000000..28e22f19 --- /dev/null +++ b/qase-api-client/docs/ReviewCreate.md @@ -0,0 +1,31 @@ +# ReviewCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**case_id** | **int** | ID of the reviewed test case. When present an `edit` review is created, otherwise a `create` review with a new-case draft. | [optional] +**reviewers** | **List[UUID]** | Author UUIDs of team members to assign as reviewers (see `GET /author`). | [optional] +**proposed_case** | [**ReviewCaseData**](ReviewCaseData.md) | For `create` reviews `title` and all required project fields are required. For `edit` reviews send only the fields the proposal changes. | + +## Example + +```python +from qase.api_client_v1.models.review_create import ReviewCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewCreate from a JSON string +review_create_instance = ReviewCreate.from_json(json) +# print the JSON string representation of the object +print(ReviewCreate.to_json()) + +# convert the object into a dict +review_create_dict = review_create_instance.to_dict() +# create an instance of ReviewCreate from a dict +review_create_from_dict = ReviewCreate.from_dict(review_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/ReviewDetailed.md b/qase-api-client/docs/ReviewDetailed.md new file mode 100644 index 00000000..33a7038e --- /dev/null +++ b/qase-api-client/docs/ReviewDetailed.md @@ -0,0 +1,38 @@ +# ReviewDetailed + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Review ID, unique within the project. | [optional] +**title** | **str** | | [optional] +**type** | **str** | `create` — the review proposes a new test case; `edit` — the review proposes changes to an existing test case. | [optional] +**status** | **str** | | [optional] +**case_id** | **int** | ID of the reviewed test case. Null for new-case draft reviews. | [optional] +**author_uuid** | **UUID** | Author UUID of the review creator (see `GET /author`). | [optional] +**reviewers** | [**List[ReviewReviewersInner]**](ReviewReviewersInner.md) | | [optional] +**created_at** | **datetime** | | [optional] +**updated_at** | **datetime** | | [optional] +**proposed_case** | **object** | The proposed test case state. Merging the review applies it to the test case. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_detailed import ReviewDetailed + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewDetailed from a JSON string +review_detailed_instance = ReviewDetailed.from_json(json) +# print the JSON string representation of the object +print(ReviewDetailed.to_json()) + +# convert the object into a dict +review_detailed_dict = review_detailed_instance.to_dict() +# create an instance of ReviewDetailed from a dict +review_detailed_from_dict = ReviewDetailed.from_dict(review_detailed_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/ReviewListResponse.md b/qase-api-client/docs/ReviewListResponse.md new file mode 100644 index 00000000..75a7f8a2 --- /dev/null +++ b/qase-api-client/docs/ReviewListResponse.md @@ -0,0 +1,30 @@ +# ReviewListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**ReviewListResponseAllOfResult**](ReviewListResponseAllOfResult.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_list_response import ReviewListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewListResponse from a JSON string +review_list_response_instance = ReviewListResponse.from_json(json) +# print the JSON string representation of the object +print(ReviewListResponse.to_json()) + +# convert the object into a dict +review_list_response_dict = review_list_response_instance.to_dict() +# create an instance of ReviewListResponse from a dict +review_list_response_from_dict = ReviewListResponse.from_dict(review_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/ReviewListResponseAllOfResult.md b/qase-api-client/docs/ReviewListResponseAllOfResult.md new file mode 100644 index 00000000..db660ba2 --- /dev/null +++ b/qase-api-client/docs/ReviewListResponseAllOfResult.md @@ -0,0 +1,32 @@ +# ReviewListResponseAllOfResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | | [optional] +**filtered** | **int** | | [optional] +**count** | **int** | | [optional] +**entities** | [**List[Review]**](Review.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_list_response_all_of_result import ReviewListResponseAllOfResult + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewListResponseAllOfResult from a JSON string +review_list_response_all_of_result_instance = ReviewListResponseAllOfResult.from_json(json) +# print the JSON string representation of the object +print(ReviewListResponseAllOfResult.to_json()) + +# convert the object into a dict +review_list_response_all_of_result_dict = review_list_response_all_of_result_instance.to_dict() +# create an instance of ReviewListResponseAllOfResult from a dict +review_list_response_all_of_result_from_dict = ReviewListResponseAllOfResult.from_dict(review_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/ReviewProposedCase.md b/qase-api-client/docs/ReviewProposedCase.md new file mode 100644 index 00000000..a4563e64 --- /dev/null +++ b/qase-api-client/docs/ReviewProposedCase.md @@ -0,0 +1,51 @@ +# ReviewProposedCase + +The test case state proposed by the review. Only the fields the proposal carries are present. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | [optional] +**description** | **str** | | [optional] +**preconditions** | **str** | | [optional] +**postconditions** | **str** | | [optional] +**severity** | **int** | | [optional] +**priority** | **int** | | [optional] +**behavior** | **int** | | [optional] +**type** | **int** | | [optional] +**layer** | **int** | | [optional] +**is_flaky** | **int** | | [optional] +**is_muted** | **bool** | | [optional] +**suite_id** | **int** | | [optional] +**milestone_id** | **int** | | [optional] +**is_manual** | **bool** | `true` if the case is manual, `false` if it is automated. | [optional] +**is_to_be_automated** | **bool** | `true` if a manual case is planned to be automated. | [optional] +**status** | **int** | | [optional] +**steps_type** | **str** | | [optional] +**attachments** | **List[str]** | Attachment hashes. | [optional] +**steps** | [**List[ReviewProposedStep]**](ReviewProposedStep.md) | | [optional] +**tags** | **List[str]** | | [optional] +**parameters** | [**List[TestCaseParameter]**](TestCaseParameter.md) | | [optional] +**custom_fields** | [**List[CustomFieldValue]**](CustomFieldValue.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_proposed_case import ReviewProposedCase + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewProposedCase from a JSON string +review_proposed_case_instance = ReviewProposedCase.from_json(json) +# print the JSON string representation of the object +print(ReviewProposedCase.to_json()) + +# convert the object into a dict +review_proposed_case_dict = review_proposed_case_instance.to_dict() +# create an instance of ReviewProposedCase from a dict +review_proposed_case_from_dict = ReviewProposedCase.from_dict(review_proposed_case_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/ReviewProposedStep.md b/qase-api-client/docs/ReviewProposedStep.md new file mode 100644 index 00000000..010e7bec --- /dev/null +++ b/qase-api-client/docs/ReviewProposedStep.md @@ -0,0 +1,35 @@ +# ReviewProposedStep + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | Step action text. Used for classic steps. For gherkin steps, use the \"value\" property instead. | [optional] +**expected_result** | **str** | | [optional] +**data** | **str** | | [optional] +**value** | **str** | Gherkin scenario text. Used when steps_type is \"gherkin\". | [optional] +**shared** | **str** | Hash of the referenced shared step. | [optional] +**attachments** | **List[str]** | A list of Attachment hashes. | [optional] +**steps** | **List[object]** | Nested steps use the same structure. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_proposed_step import ReviewProposedStep + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewProposedStep from a JSON string +review_proposed_step_instance = ReviewProposedStep.from_json(json) +# print the JSON string representation of the object +print(ReviewProposedStep.to_json()) + +# convert the object into a dict +review_proposed_step_dict = review_proposed_step_instance.to_dict() +# create an instance of ReviewProposedStep from a dict +review_proposed_step_from_dict = ReviewProposedStep.from_dict(review_proposed_step_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/ReviewResponse.md b/qase-api-client/docs/ReviewResponse.md new file mode 100644 index 00000000..9e8b1218 --- /dev/null +++ b/qase-api-client/docs/ReviewResponse.md @@ -0,0 +1,30 @@ +# ReviewResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **bool** | | [optional] +**result** | [**ReviewDetailed**](ReviewDetailed.md) | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_response import ReviewResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewResponse from a JSON string +review_response_instance = ReviewResponse.from_json(json) +# print the JSON string representation of the object +print(ReviewResponse.to_json()) + +# convert the object into a dict +review_response_dict = review_response_instance.to_dict() +# create an instance of ReviewResponse from a dict +review_response_from_dict = ReviewResponse.from_dict(review_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/ReviewReviewersInner.md b/qase-api-client/docs/ReviewReviewersInner.md new file mode 100644 index 00000000..a8e6a2ab --- /dev/null +++ b/qase-api-client/docs/ReviewReviewersInner.md @@ -0,0 +1,30 @@ +# ReviewReviewersInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author_uuid** | **UUID** | Author UUID of the reviewer (see `GET /author`). | [optional] +**status** | **str** | | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_reviewers_inner import ReviewReviewersInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewReviewersInner from a JSON string +review_reviewers_inner_instance = ReviewReviewersInner.from_json(json) +# print the JSON string representation of the object +print(ReviewReviewersInner.to_json()) + +# convert the object into a dict +review_reviewers_inner_dict = review_reviewers_inner_instance.to_dict() +# create an instance of ReviewReviewersInner from a dict +review_reviewers_inner_from_dict = ReviewReviewersInner.from_dict(review_reviewers_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/qase-api-client/docs/ReviewStepData.md b/qase-api-client/docs/ReviewStepData.md new file mode 100644 index 00000000..0f5bdb23 --- /dev/null +++ b/qase-api-client/docs/ReviewStepData.md @@ -0,0 +1,36 @@ +# ReviewStepData + +A step of the proposed test case. When `steps_type` is `gherkin` the step carries the scenario in `value` and nothing else: a non-empty `action`, `expected_result`, `data`, `attachments`, `shared` or nested `steps` is rejected. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | Step action text. Classic steps only. | [optional] +**shared** | **str** | Hash of an existing shared step to insert at this position. | [optional] +**expected_result** | **str** | | [optional] +**data** | **str** | | [optional] +**value** | **str** | Gherkin scenario text. Used when steps_type is \"gherkin\". Example: \"Given a user exists\\nWhen they log in\\nThen they see the dashboard\" | [optional] +**attachments** | **List[str]** | A list of Attachment hashes. | [optional] +**steps** | **List[object]** | Nested steps may be passed here. Use same structure for them. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_step_data import ReviewStepData + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewStepData from a JSON string +review_step_data_instance = ReviewStepData.from_json(json) +# print the JSON string representation of the object +print(ReviewStepData.to_json()) + +# convert the object into a dict +review_step_data_dict = review_step_data_instance.to_dict() +# create an instance of ReviewStepData from a dict +review_step_data_from_dict = ReviewStepData.from_dict(review_step_data_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/ReviewUpdate.md b/qase-api-client/docs/ReviewUpdate.md new file mode 100644 index 00000000..93ca4ceb --- /dev/null +++ b/qase-api-client/docs/ReviewUpdate.md @@ -0,0 +1,30 @@ +# ReviewUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviewers** | **List[UUID]** | Author UUIDs of team members assigned as reviewers (see `GET /author`). When provided, replaces the current reviewer list; an empty array removes all reviewers. Omit to leave reviewers unchanged. | [optional] +**proposed_case** | [**ReviewCaseData**](ReviewCaseData.md) | Sent fields are merged into the stored proposal. Changing the proposal resets all existing approvals; updating only the reviewers keeps them. | [optional] + +## Example + +```python +from qase.api_client_v1.models.review_update import ReviewUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ReviewUpdate from a JSON string +review_update_instance = ReviewUpdate.from_json(json) +# print the JSON string representation of the object +print(ReviewUpdate.to_json()) + +# convert the object into a dict +review_update_dict = review_update_instance.to_dict() +# create an instance of ReviewUpdate from a dict +review_update_from_dict = ReviewUpdate.from_dict(review_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/ReviewsApi.md b/qase-api-client/docs/ReviewsApi.md new file mode 100644 index 00000000..6d63fb49 --- /dev/null +++ b/qase-api-client/docs/ReviewsApi.md @@ -0,0 +1,576 @@ +# qase.api_client_v1.ReviewsApi + +All URIs are relative to *https://api.qase.io/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulk_create_reviews**](ReviewsApi.md#bulk_create_reviews) | **POST** /review/{code}/bulk | Create reviews in bulk +[**create_review**](ReviewsApi.md#create_review) | **POST** /review/{code} | Create a new review +[**delete_review**](ReviewsApi.md#delete_review) | **DELETE** /review/{code}/{id} | Delete review +[**get_review**](ReviewsApi.md#get_review) | **GET** /review/{code}/{id} | Get a specific review +[**get_reviews**](ReviewsApi.md#get_reviews) | **GET** /review/{code} | Get all reviews +[**update_review**](ReviewsApi.md#update_review) | **PATCH** /review/{code}/{id} | Update review + + +# **bulk_create_reviews** +> ReviewBulkResponse bulk_create_reviews(code, review_bulk) + +Create reviews in bulk + +This method allows to submit multiple test cases for review in one request. + +Returns an error if test case review is disabled in the project settings. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.review_bulk import ReviewBulk +from qase.api_client_v1.models.review_bulk_response import ReviewBulkResponse +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + review_bulk = qase.api_client_v1.ReviewBulk() # ReviewBulk | + + try: + # Create reviews in bulk + api_response = api_instance.bulk_create_reviews(code, review_bulk) + print("The response of ReviewsApi->bulk_create_reviews:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->bulk_create_reviews: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **review_bulk** | [**ReviewBulk**](ReviewBulk.md)| | + +### Return type + +[**ReviewBulkResponse**](ReviewBulkResponse.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** | Per-item outcomes for the submitted reviews. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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) + +# **create_review** +> IdResponse create_review(code, review_create) + +Create a new review + +This method allows to submit a test case for review in selected project. + +Returns an error if test case review is disabled in the project settings. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.id_response import IdResponse +from qase.api_client_v1.models.review_create import ReviewCreate +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + review_create = qase.api_client_v1.ReviewCreate() # ReviewCreate | + + try: + # Create a new review + api_response = api_instance.create_review(code, review_create) + print("The response of ReviewsApi->create_review:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->create_review: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **review_create** | [**ReviewCreate**](ReviewCreate.md)| | + +### Return type + +[**IdResponse**](IdResponse.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 result. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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_review** +> IdResponse delete_review(code, id) + +Delete review + +This method allows to delete a review. Merged reviews cannot be deleted. + +Returns an error if test case review is disabled in the project settings. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.id_response import IdResponse +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + id = 56 # int | Identifier. + + try: + # Delete review + api_response = api_instance.delete_review(code, id) + print("The response of ReviewsApi->delete_review:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->delete_review: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **id** | **int**| Identifier. | + +### Return type + +[**IdResponse**](IdResponse.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 result. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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) + +# **get_review** +> ReviewResponse get_review(code, id) + +Get a specific review + +This method allows to retrieve a specific review, including its current +approval status per reviewer. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.review_response import ReviewResponse +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + id = 56 # int | Identifier. + + try: + # Get a specific review + api_response = api_instance.get_review(code, id) + print("The response of ReviewsApi->get_review:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->get_review: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **id** | **int**| Identifier. | + +### Return type + +[**ReviewResponse**](ReviewResponse.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 Review. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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_reviews** +> ReviewListResponse get_reviews(code, status=status, type=type, case_id=case_id, author_uuid=author_uuid, reviewer_uuid=reviewer_uuid, search=search, limit=limit, offset=offset) + +Get all reviews + +This method allows to retrieve all test case reviews stored in selected project. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.review_list_response import ReviewListResponse +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + status = 'status_example' # str | (optional) + type = 'type_example' # str | (optional) + case_id = 56 # int | Filter reviews by the reviewed test case ID. (optional) + author_uuid = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | Filter reviews by the author who created them (author UUID). (optional) + reviewer_uuid = UUID('38400000-8cf0-11bd-b23e-10b96e4ef00d') # UUID | Filter reviews by an assigned reviewer (author UUID). (optional) + search = 'search_example' # str | Provide a string that will be used to search by review title. (optional) + 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) + + try: + # Get all reviews + api_response = api_instance.get_reviews(code, status=status, type=type, case_id=case_id, author_uuid=author_uuid, reviewer_uuid=reviewer_uuid, search=search, limit=limit, offset=offset) + print("The response of ReviewsApi->get_reviews:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->get_reviews: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **status** | **str**| | [optional] + **type** | **str**| | [optional] + **case_id** | **int**| Filter reviews by the reviewed test case ID. | [optional] + **author_uuid** | **UUID**| Filter reviews by the author who created them (author UUID). | [optional] + **reviewer_uuid** | **UUID**| Filter reviews by an assigned reviewer (author UUID). | [optional] + **search** | **str**| Provide a string that will be used to search by review title. | [optional] + **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] + +### Return type + +[**ReviewListResponse**](ReviewListResponse.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 reviews. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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_review** +> IdResponse update_review(code, id, review_update) + +Update review + +This method allows to update the assigned reviewers and/or the proposed +test case payload of an open review. The reviewed test case cannot be changed. + +Returns an error if test case review is disabled in the project settings, +or if the review is not open. + + +### Example + +* Api Key Authentication (TokenAuth): + +```python +import qase.api_client_v1 +from qase.api_client_v1.models.id_response import IdResponse +from qase.api_client_v1.models.review_update import ReviewUpdate +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.ReviewsApi(api_client) + code = 'code_example' # str | Code of project, where to search entities. + id = 56 # int | Identifier. + review_update = qase.api_client_v1.ReviewUpdate() # ReviewUpdate | + + try: + # Update review + api_response = api_instance.update_review(code, id, review_update) + print("The response of ReviewsApi->update_review:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReviewsApi->update_review: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **code** | **str**| Code of project, where to search entities. | + **id** | **int**| Identifier. | + **review_update** | [**ReviewUpdate**](ReviewUpdate.md)| | + +### Return type + +[**IdResponse**](IdResponse.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 result. | - | +**400** | Bad Request. | - | +**401** | Unauthorized. | - | +**402** | Payment Required. | - | +**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) + diff --git a/qase-api-client/docs/TestStepCreate.md b/qase-api-client/docs/TestStepCreate.md index 4c6909a7..aef5c7ac 100644 --- a/qase-api-client/docs/TestStepCreate.md +++ b/qase-api-client/docs/TestStepCreate.md @@ -1,5 +1,6 @@ # TestStepCreate +When `steps_type` is `gherkin` only the scenario text is read from a step. A non-empty `expected_result`, `data`, `attachments`, `shared` or nested `steps` is rejected, and so is sending the scenario in `value` and `action` at once. ## Properties diff --git a/qase-api-client/pyproject.toml b/qase-api-client/pyproject.toml index 33477f02..8aba0bb7 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 = "2.0.12" +version = "2.0.13" 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 82ba9619..e72d7f8a 100644 --- a/qase-api-client/src/qase/api_client_v1/__init__.py +++ b/qase-api-client/src/qase/api_client_v1/__init__.py @@ -30,6 +30,7 @@ "PlansApi", "ProjectsApi", "ResultsApi", + "ReviewsApi", "RunsApi", "SearchApi", "SharedParametersApi", @@ -143,6 +144,22 @@ "ResultQuery", "ResultResponse", "ResultUpdate", + "Review", + "ReviewBulk", + "ReviewBulkResponse", + "ReviewBulkResponseAllOfResult", + "ReviewBulkResponseAllOfResultItems", + "ReviewCaseData", + "ReviewCreate", + "ReviewDetailed", + "ReviewListResponse", + "ReviewListResponseAllOfResult", + "ReviewProposedCase", + "ReviewProposedStep", + "ReviewResponse", + "ReviewReviewersInner", + "ReviewStepData", + "ReviewUpdate", "Run", "RunCreate", "RunCreateCloudRunConfig", @@ -231,6 +248,7 @@ from qase.api_client_v1.api.plans_api import PlansApi as PlansApi from qase.api_client_v1.api.projects_api import ProjectsApi as ProjectsApi from qase.api_client_v1.api.results_api import ResultsApi as ResultsApi +from qase.api_client_v1.api.reviews_api import ReviewsApi as ReviewsApi from qase.api_client_v1.api.runs_api import RunsApi as RunsApi from qase.api_client_v1.api.search_api import SearchApi as SearchApi from qase.api_client_v1.api.shared_parameters_api import SharedParametersApi as SharedParametersApi @@ -348,6 +366,22 @@ from qase.api_client_v1.models.result_query import ResultQuery as ResultQuery from qase.api_client_v1.models.result_response import ResultResponse as ResultResponse from qase.api_client_v1.models.result_update import ResultUpdate as ResultUpdate +from qase.api_client_v1.models.review import Review as Review +from qase.api_client_v1.models.review_bulk import ReviewBulk as ReviewBulk +from qase.api_client_v1.models.review_bulk_response import ReviewBulkResponse as ReviewBulkResponse +from qase.api_client_v1.models.review_bulk_response_all_of_result import ReviewBulkResponseAllOfResult as ReviewBulkResponseAllOfResult +from qase.api_client_v1.models.review_bulk_response_all_of_result_items import ReviewBulkResponseAllOfResultItems as ReviewBulkResponseAllOfResultItems +from qase.api_client_v1.models.review_case_data import ReviewCaseData as ReviewCaseData +from qase.api_client_v1.models.review_create import ReviewCreate as ReviewCreate +from qase.api_client_v1.models.review_detailed import ReviewDetailed as ReviewDetailed +from qase.api_client_v1.models.review_list_response import ReviewListResponse as ReviewListResponse +from qase.api_client_v1.models.review_list_response_all_of_result import ReviewListResponseAllOfResult as ReviewListResponseAllOfResult +from qase.api_client_v1.models.review_proposed_case import ReviewProposedCase as ReviewProposedCase +from qase.api_client_v1.models.review_proposed_step import ReviewProposedStep as ReviewProposedStep +from qase.api_client_v1.models.review_response import ReviewResponse as ReviewResponse +from qase.api_client_v1.models.review_reviewers_inner import ReviewReviewersInner as ReviewReviewersInner +from qase.api_client_v1.models.review_step_data import ReviewStepData as ReviewStepData +from qase.api_client_v1.models.review_update import ReviewUpdate as ReviewUpdate from qase.api_client_v1.models.run import Run as Run from qase.api_client_v1.models.run_create import RunCreate as RunCreate from qase.api_client_v1.models.run_create_cloud_run_config import RunCreateCloudRunConfig as RunCreateCloudRunConfig 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 977bfbc8..7f82026a 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 @@ -12,6 +12,7 @@ from qase.api_client_v1.api.plans_api import PlansApi from qase.api_client_v1.api.projects_api import ProjectsApi from qase.api_client_v1.api.results_api import ResultsApi +from qase.api_client_v1.api.reviews_api import ReviewsApi 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 diff --git a/qase-api-client/src/qase/api_client_v1/api/authors_api.py b/qase-api-client/src/qase/api_client_v1/api/authors_api.py index 304de26c..b9f5a9e4 100644 --- a/qase-api-client/src/qase/api_client_v1/api/authors_api.py +++ b/qase-api-client/src/qase/api_client_v1/api/authors_api.py @@ -16,7 +16,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr, field_validator +from pydantic import Field, StrictStr, field_validator from typing import Optional from typing_extensions import Annotated from qase.api_client_v1.models.author_list_response import AuthorListResponse @@ -43,7 +43,7 @@ def __init__(self, api_client=None) -> None: @validate_call def get_author( self, - id: Annotated[StrictInt, Field(description="Identifier.")], + id: Annotated[StrictStr, Field(description="Author UUID, or the deprecated integer author ID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -61,8 +61,8 @@ def get_author( This method allows to retrieve a specific author. - :param id: Identifier. (required) - :type id: int + :param id: Author UUID, or the deprecated integer author ID. (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 @@ -115,7 +115,7 @@ def get_author( @validate_call def get_author_with_http_info( self, - id: Annotated[StrictInt, Field(description="Identifier.")], + id: Annotated[StrictStr, Field(description="Author UUID, or the deprecated integer author ID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -133,8 +133,8 @@ def get_author_with_http_info( This method allows to retrieve a specific author. - :param id: Identifier. (required) - :type id: int + :param id: Author UUID, or the deprecated integer author ID. (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 @@ -187,7 +187,7 @@ def get_author_with_http_info( @validate_call def get_author_without_preload_content( self, - id: Annotated[StrictInt, Field(description="Identifier.")], + id: Annotated[StrictStr, Field(description="Author UUID, or the deprecated integer author ID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -205,8 +205,8 @@ def get_author_without_preload_content( This method allows to retrieve a specific author. - :param id: Identifier. (required) - :type id: int + :param id: Author UUID, or the deprecated integer author ID. (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 diff --git a/qase-api-client/src/qase/api_client_v1/api/reviews_api.py b/qase-api-client/src/qase/api_client_v1/api/reviews_api.py new file mode 100644 index 00000000..a5ba3989 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/api/reviews_api.py @@ -0,0 +1,1997 @@ +""" + 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, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from uuid import UUID +from qase.api_client_v1.models.id_response import IdResponse +from qase.api_client_v1.models.review_bulk import ReviewBulk +from qase.api_client_v1.models.review_bulk_response import ReviewBulkResponse +from qase.api_client_v1.models.review_create import ReviewCreate +from qase.api_client_v1.models.review_list_response import ReviewListResponse +from qase.api_client_v1.models.review_response import ReviewResponse +from qase.api_client_v1.models.review_update import ReviewUpdate + +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 ReviewsApi: + """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 bulk_create_reviews( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_bulk: ReviewBulk, + _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, + ) -> ReviewBulkResponse: + """Create reviews in bulk + + This method allows to submit multiple test cases for review in one request. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_bulk: (required) + :type review_bulk: ReviewBulk + :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._bulk_create_reviews_serialize( + code=code, + review_bulk=review_bulk, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewBulkResponse", + '400': None, + '401': None, + '402': 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 bulk_create_reviews_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_bulk: ReviewBulk, + _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[ReviewBulkResponse]: + """Create reviews in bulk + + This method allows to submit multiple test cases for review in one request. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_bulk: (required) + :type review_bulk: ReviewBulk + :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._bulk_create_reviews_serialize( + code=code, + review_bulk=review_bulk, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewBulkResponse", + '400': None, + '401': None, + '402': 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 bulk_create_reviews_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_bulk: ReviewBulk, + _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 reviews in bulk + + This method allows to submit multiple test cases for review in one request. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_bulk: (required) + :type review_bulk: ReviewBulk + :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._bulk_create_reviews_serialize( + code=code, + review_bulk=review_bulk, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewBulkResponse", + '400': None, + '401': None, + '402': 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 _bulk_create_reviews_serialize( + self, + code, + review_bulk, + _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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if review_bulk is not None: + _body_params = review_bulk + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/review/{code}/bulk', + 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 create_review( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_create: ReviewCreate, + _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, + ) -> IdResponse: + """Create a new review + + This method allows to submit a test case for review in selected project. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_create: (required) + :type review_create: ReviewCreate + :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_review_serialize( + code=code, + review_create=review_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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_review_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_create: ReviewCreate, + _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[IdResponse]: + """Create a new review + + This method allows to submit a test case for review in selected project. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_create: (required) + :type review_create: ReviewCreate + :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_review_serialize( + code=code, + review_create=review_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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_review_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + review_create: ReviewCreate, + _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 review + + This method allows to submit a test case for review in selected project. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param review_create: (required) + :type review_create: ReviewCreate + :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_review_serialize( + code=code, + review_create=review_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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_review_serialize( + self, + code, + review_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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if review_create is not None: + _body_params = review_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/review/{code}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_review( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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, + ) -> IdResponse: + """Delete review + + This method allows to delete a review. Merged reviews cannot be deleted. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 delete_review_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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[IdResponse]: + """Delete review + + This method allows to delete a review. Merged reviews cannot be deleted. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 delete_review_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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 review + + This method allows to delete a review. Merged reviews cannot be deleted. Returns an error if test case review is disabled in the project settings. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 _delete_review_serialize( + self, + code, + 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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/review/{code}/{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_review( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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, + ) -> ReviewResponse: + """Get a specific review + + This method allows to retrieve a specific review, including its current approval status per reviewer. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewResponse", + '400': None, + '401': None, + '402': 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_review_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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[ReviewResponse]: + """Get a specific review + + This method allows to retrieve a specific review, including its current approval status per reviewer. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewResponse", + '400': None, + '401': None, + '402': 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_review_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, 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 review + + This method allows to retrieve a specific review, including its current approval status per reviewer. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_review_serialize( + code=code, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewResponse", + '400': None, + '401': None, + '402': 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_review_serialize( + self, + code, + 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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/review/{code}/{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_reviews( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + status: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + case_id: Annotated[Optional[StrictInt], Field(description="Filter reviews by the reviewed test case ID.")] = None, + author_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by the author who created them (author UUID).")] = None, + reviewer_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by an assigned reviewer (author UUID).")] = None, + search: Annotated[Optional[StrictStr], Field(description="Provide a string that will be used to search by review title.")] = None, + 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, + _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, + ) -> ReviewListResponse: + """Get all reviews + + This method allows to retrieve all test case reviews stored in selected project. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param status: + :type status: str + :param type: + :type type: str + :param case_id: Filter reviews by the reviewed test case ID. + :type case_id: int + :param author_uuid: Filter reviews by the author who created them (author UUID). + :type author_uuid: UUID + :param reviewer_uuid: Filter reviews by an assigned reviewer (author UUID). + :type reviewer_uuid: UUID + :param search: Provide a string that will be used to search by review title. + :type search: str + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_reviews_serialize( + code=code, + status=status, + type=type, + case_id=case_id, + author_uuid=author_uuid, + reviewer_uuid=reviewer_uuid, + search=search, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewListResponse", + '400': None, + '401': None, + '402': 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_reviews_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + status: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + case_id: Annotated[Optional[StrictInt], Field(description="Filter reviews by the reviewed test case ID.")] = None, + author_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by the author who created them (author UUID).")] = None, + reviewer_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by an assigned reviewer (author UUID).")] = None, + search: Annotated[Optional[StrictStr], Field(description="Provide a string that will be used to search by review title.")] = None, + 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, + _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[ReviewListResponse]: + """Get all reviews + + This method allows to retrieve all test case reviews stored in selected project. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param status: + :type status: str + :param type: + :type type: str + :param case_id: Filter reviews by the reviewed test case ID. + :type case_id: int + :param author_uuid: Filter reviews by the author who created them (author UUID). + :type author_uuid: UUID + :param reviewer_uuid: Filter reviews by an assigned reviewer (author UUID). + :type reviewer_uuid: UUID + :param search: Provide a string that will be used to search by review title. + :type search: str + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_reviews_serialize( + code=code, + status=status, + type=type, + case_id=case_id, + author_uuid=author_uuid, + reviewer_uuid=reviewer_uuid, + search=search, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewListResponse", + '400': None, + '401': None, + '402': 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_reviews_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + status: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + case_id: Annotated[Optional[StrictInt], Field(description="Filter reviews by the reviewed test case ID.")] = None, + author_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by the author who created them (author UUID).")] = None, + reviewer_uuid: Annotated[Optional[UUID], Field(description="Filter reviews by an assigned reviewer (author UUID).")] = None, + search: Annotated[Optional[StrictStr], Field(description="Provide a string that will be used to search by review title.")] = None, + 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, + _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 reviews + + This method allows to retrieve all test case reviews stored in selected project. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param status: + :type status: str + :param type: + :type type: str + :param case_id: Filter reviews by the reviewed test case ID. + :type case_id: int + :param author_uuid: Filter reviews by the author who created them (author UUID). + :type author_uuid: UUID + :param reviewer_uuid: Filter reviews by an assigned reviewer (author UUID). + :type reviewer_uuid: UUID + :param search: Provide a string that will be used to search by review title. + :type search: str + :param limit: A number of entities in result set. + :type limit: int + :param offset: How many entities should be skipped. + :type offset: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_reviews_serialize( + code=code, + status=status, + type=type, + case_id=case_id, + author_uuid=author_uuid, + reviewer_uuid=reviewer_uuid, + search=search, + limit=limit, + offset=offset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReviewListResponse", + '400': None, + '401': None, + '402': 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_reviews_serialize( + self, + code, + status, + type, + case_id, + author_uuid, + reviewer_uuid, + search, + limit, + offset, + _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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + # process the query parameters + if status is not None: + + _query_params.append(('status', status)) + + if type is not None: + + _query_params.append(('type', type)) + + if case_id is not None: + + _query_params.append(('case_id', case_id)) + + if author_uuid is not None: + + _query_params.append(('author_uuid', author_uuid)) + + if reviewer_uuid is not None: + + _query_params.append(('reviewer_uuid', reviewer_uuid)) + + if search is not None: + + _query_params.append(('search', search)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/review/{code}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_review( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, Field(description="Identifier.")], + review_update: ReviewUpdate, + _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, + ) -> IdResponse: + """Update review + + This method allows to update the assigned reviewers and/or the proposed test case payload of an open review. The reviewed test case cannot be changed. Returns an error if test case review is disabled in the project settings, or if the review is not open. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param review_update: (required) + :type review_update: ReviewUpdate + :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_review_serialize( + code=code, + id=id, + review_update=review_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 update_review_with_http_info( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, Field(description="Identifier.")], + review_update: ReviewUpdate, + _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[IdResponse]: + """Update review + + This method allows to update the assigned reviewers and/or the proposed test case payload of an open review. The reviewed test case cannot be changed. Returns an error if test case review is disabled in the project settings, or if the review is not open. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param review_update: (required) + :type review_update: ReviewUpdate + :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_review_serialize( + code=code, + id=id, + review_update=review_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 update_review_without_preload_content( + self, + code: Annotated[str, Field(min_length=2, strict=True, max_length=10, description="Code of project, where to search entities.")], + id: Annotated[StrictInt, Field(description="Identifier.")], + review_update: ReviewUpdate, + _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 review + + This method allows to update the assigned reviewers and/or the proposed test case payload of an open review. The reviewed test case cannot be changed. Returns an error if test case review is disabled in the project settings, or if the review is not open. + + :param code: Code of project, where to search entities. (required) + :type code: str + :param id: Identifier. (required) + :type id: int + :param review_update: (required) + :type review_update: ReviewUpdate + :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_review_serialize( + code=code, + id=id, + review_update=review_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IdResponse", + '400': None, + '401': None, + '402': 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 _update_review_serialize( + self, + code, + id, + review_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, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if code is not None: + _path_params['code'] = code + 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 review_update is not None: + _body_params = review_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'TokenAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/review/{code}/{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 426c5699..bafbf242 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 @@ -111,6 +111,22 @@ from qase.api_client_v1.models.result_query import ResultQuery from qase.api_client_v1.models.result_response import ResultResponse from qase.api_client_v1.models.result_update import ResultUpdate +from qase.api_client_v1.models.review import Review +from qase.api_client_v1.models.review_bulk import ReviewBulk +from qase.api_client_v1.models.review_bulk_response import ReviewBulkResponse +from qase.api_client_v1.models.review_bulk_response_all_of_result import ReviewBulkResponseAllOfResult +from qase.api_client_v1.models.review_bulk_response_all_of_result_items import ReviewBulkResponseAllOfResultItems +from qase.api_client_v1.models.review_case_data import ReviewCaseData +from qase.api_client_v1.models.review_create import ReviewCreate +from qase.api_client_v1.models.review_detailed import ReviewDetailed +from qase.api_client_v1.models.review_list_response import ReviewListResponse +from qase.api_client_v1.models.review_list_response_all_of_result import ReviewListResponseAllOfResult +from qase.api_client_v1.models.review_proposed_case import ReviewProposedCase +from qase.api_client_v1.models.review_proposed_step import ReviewProposedStep +from qase.api_client_v1.models.review_response import ReviewResponse +from qase.api_client_v1.models.review_reviewers_inner import ReviewReviewersInner +from qase.api_client_v1.models.review_step_data import ReviewStepData +from qase.api_client_v1.models.review_update import ReviewUpdate from qase.api_client_v1.models.run import Run from qase.api_client_v1.models.run_create import RunCreate from qase.api_client_v1.models.run_create_cloud_run_config import RunCreateCloudRunConfig diff --git a/qase-api-client/src/qase/api_client_v1/models/author.py b/qase-api-client/src/qase/api_client_v1/models/author.py index 2d020f49..0176b44b 100644 --- a/qase-api-client/src/qase/api_client_v1/models/author.py +++ b/qase-api-client/src/qase/api_client_v1/models/author.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID from typing import Optional, Set from typing_extensions import Self @@ -28,13 +29,14 @@ class Author(BaseModel): Author """ # noqa: E501 id: Optional[StrictInt] = None - author_id: Optional[StrictInt] = None + uuid: Optional[UUID] = Field(default=None, description="Author UUID. Use it to reference the author in other API methods.") + author_id: Optional[StrictInt] = Field(default=None, description="Deprecated, use `uuid` instead.") entity_type: Optional[StrictStr] = None entity_id: Optional[StrictInt] = None email: Optional[StrictStr] = None name: Optional[StrictStr] = None is_active: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["id", "author_id", "entity_type", "entity_id", "email", "name", "is_active"] + __properties: ClassVar[List[str]] = ["id", "uuid", "author_id", "entity_type", "entity_id", "email", "name", "is_active"] model_config = ConfigDict( populate_by_name=True, @@ -88,6 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), + "uuid": obj.get("uuid"), "author_id": obj.get("author_id"), "entity_type": obj.get("entity_type"), "entity_id": obj.get("entity_id"), diff --git a/qase-api-client/src/qase/api_client_v1/models/review.py b/qase-api-client/src/qase/api_client_v1/models/review.py new file mode 100644 index 00000000..39390b6b --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review.py @@ -0,0 +1,149 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from qase.api_client_v1.models.review_reviewers_inner import ReviewReviewersInner +from typing import Optional, Set +from typing_extensions import Self + +class Review(BaseModel): + """ + Review + """ # noqa: E501 + id: Optional[StrictInt] = Field(default=None, description="Review ID, unique within the project.") + title: Optional[StrictStr] = None + type: Optional[StrictStr] = Field(default=None, description="`create` — the review proposes a new test case; `edit` — the review proposes changes to an existing test case.") + status: Optional[StrictStr] = None + case_id: Optional[StrictInt] = Field(default=None, description="ID of the reviewed test case. Null for new-case draft reviews.") + author_uuid: Optional[UUID] = Field(default=None, description="Author UUID of the review creator (see `GET /author`).") + reviewers: Optional[List[ReviewReviewersInner]] = None + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["id", "title", "type", "status", "case_id", "author_uuid", "reviewers", "created_at", "updated_at"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['create', 'edit']): + raise ValueError("must be one of enum values ('create', 'edit')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['open', 'merged', 'declined']): + raise ValueError("must be one of enum values ('open', 'merged', 'declined')") + 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 Review 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 reviewers (list) + _items = [] + if self.reviewers: + for _item_reviewers in self.reviewers: + if _item_reviewers: + _items.append(_item_reviewers.to_dict()) + _dict['reviewers'] = _items + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['case_id'] = None + + # set to None if author_uuid (nullable) is None + # and model_fields_set contains the field + if self.author_uuid is None and "author_uuid" in self.model_fields_set: + _dict['author_uuid'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Review 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"), + "status": obj.get("status"), + "case_id": obj.get("case_id"), + "author_uuid": obj.get("author_uuid"), + "reviewers": [ReviewReviewersInner.from_dict(_item) for _item in obj["reviewers"]] if obj.get("reviewers") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_bulk.py b/qase-api-client/src/qase/api_client_v1/models/review_bulk.py new file mode 100644 index 00000000..0c307e95 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_bulk.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.review_create import ReviewCreate +from typing import Optional, Set +from typing_extensions import Self + +class ReviewBulk(BaseModel): + """ + ReviewBulk + """ # noqa: E501 + reviews: Annotated[List[ReviewCreate], Field(min_length=1, max_length=100)] = Field(description="Validated as a whole: if any item is invalid nothing is created. Otherwise each item is processed on its own and reported in the response.") + __properties: ClassVar[List[str]] = ["reviews"] + + 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 ReviewBulk 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 reviews (list) + _items = [] + if self.reviews: + for _item_reviews in self.reviews: + if _item_reviews: + _items.append(_item_reviews.to_dict()) + _dict['reviews'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewBulk from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "reviews": [ReviewCreate.from_dict(_item) for _item in obj["reviews"]] if obj.get("reviews") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_bulk_response.py b/qase-api-client/src/qase/api_client_v1/models/review_bulk_response.py new file mode 100644 index 00000000..80fdb3fb --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_bulk_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.review_bulk_response_all_of_result import ReviewBulkResponseAllOfResult +from typing import Optional, Set +from typing_extensions import Self + +class ReviewBulkResponse(BaseModel): + """ + ReviewBulkResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[ReviewBulkResponseAllOfResult] = 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 ReviewBulkResponse 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 ReviewBulkResponse 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": ReviewBulkResponseAllOfResult.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/review_bulk_response_all_of_result.py b/qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result.py new file mode 100644 index 00000000..f66da7e6 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result.py @@ -0,0 +1,96 @@ +# 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, Optional +from qase.api_client_v1.models.review_bulk_response_all_of_result_items import ReviewBulkResponseAllOfResultItems +from typing import Optional, Set +from typing_extensions import Self + +class ReviewBulkResponseAllOfResult(BaseModel): + """ + ReviewBulkResponseAllOfResult + """ # noqa: E501 + items: Optional[List[ReviewBulkResponseAllOfResultItems]] = Field(default=None, description="Per-item outcomes, in request order.") + __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 ReviewBulkResponseAllOfResult 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_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict['items'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewBulkResponseAllOfResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "items": [ReviewBulkResponseAllOfResultItems.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/review_bulk_response_all_of_result_items.py b/qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result_items.py new file mode 100644 index 00000000..84229632 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_bulk_response_all_of_result_items.py @@ -0,0 +1,107 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReviewBulkResponseAllOfResultItems(BaseModel): + """ + ReviewBulkResponseAllOfResultItems + """ # noqa: E501 + review_id: Optional[StrictInt] = Field(default=None, description="ID of the created review. Null when the item failed.") + case_id: Optional[StrictInt] = Field(default=None, description="The `case_id` submitted with the item, echoed back for correlation. Null for new-case draft reviews.") + error: Optional[StrictStr] = Field(default=None, description="Failure reason. Null when the item was created.") + __properties: ClassVar[List[str]] = ["review_id", "case_id", "error"] + + 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 ReviewBulkResponseAllOfResultItems 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 review_id (nullable) is None + # and model_fields_set contains the field + if self.review_id is None and "review_id" in self.model_fields_set: + _dict['review_id'] = None + + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['case_id'] = None + + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewBulkResponseAllOfResultItems from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "review_id": obj.get("review_id"), + "case_id": obj.get("case_id"), + "error": obj.get("error") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_case_data.py b/qase-api-client/src/qase/api_client_v1/models/review_case_data.py new file mode 100644 index 00000000..547af3ca --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_case_data.py @@ -0,0 +1,227 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.review_step_data import ReviewStepData +from qase.api_client_v1.models.test_case_parameter_create import TestCaseParameterCreate +from typing import Optional, Set +from typing_extensions import Self + +class ReviewCaseData(BaseModel): + """ + The test case fields proposed by the review. + """ # noqa: E501 + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[StrictStr] = None + preconditions: Optional[StrictStr] = None + postconditions: Optional[StrictStr] = None + severity: Optional[StrictInt] = None + priority: Optional[StrictInt] = None + behavior: Optional[StrictInt] = None + type: Optional[StrictInt] = None + layer: Optional[StrictInt] = None + is_flaky: Optional[StrictInt] = None + is_muted: Optional[StrictBool] = Field(default=None, description="Mute state of the proposed test case.") + suite_id: Optional[StrictInt] = None + milestone_id: Optional[StrictInt] = None + is_manual: Optional[StrictBool] = Field(default=None, description="`true` if the case is manual, `false` if it is automated.") + is_to_be_automated: Optional[StrictBool] = Field(default=None, description="`true` if a manual case is planned to be automated.") + status: Optional[StrictInt] = None + steps_type: Optional[StrictStr] = Field(default=None, description="Format of the steps field. Omit to keep the current one, `classic` for a new-case draft; changing it requires sending `steps` in the same request.") + attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") + steps: Optional[List[ReviewStepData]] = Field(default=None, description="For gherkin steps send the scenario in `value`.") + tags: Optional[List[StrictStr]] = None + parameters: Optional[List[TestCaseParameterCreate]] = None + custom_field: Optional[Dict[str, StrictStr]] = Field(default=None, description="Map of custom field ID to value. A `create` review must carry every required custom field. An `edit` review is validated against the current test case, so send only the fields the proposal changes.") + __properties: ClassVar[List[str]] = ["title", "description", "preconditions", "postconditions", "severity", "priority", "behavior", "type", "layer", "is_flaky", "is_muted", "suite_id", "milestone_id", "is_manual", "is_to_be_automated", "status", "steps_type", "attachments", "steps", "tags", "parameters", "custom_field"] + + @field_validator('steps_type') + def steps_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['classic', 'gherkin']): + raise ValueError("must be one of enum values ('classic', 'gherkin')") + 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 ReviewCaseData 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 steps (list) + _items = [] + if self.steps: + for _item_steps in self.steps: + if _item_steps: + _items.append(_item_steps.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_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if preconditions (nullable) is None + # and model_fields_set contains the field + if self.preconditions is None and "preconditions" in self.model_fields_set: + _dict['preconditions'] = None + + # set to None if postconditions (nullable) is None + # and model_fields_set contains the field + if self.postconditions is None and "postconditions" in self.model_fields_set: + _dict['postconditions'] = None + + # set to None if severity (nullable) is None + # and model_fields_set contains the field + if self.severity is None and "severity" in self.model_fields_set: + _dict['severity'] = None + + # set to None if priority (nullable) is None + # and model_fields_set contains the field + if self.priority is None and "priority" in self.model_fields_set: + _dict['priority'] = None + + # set to None if behavior (nullable) is None + # and model_fields_set contains the field + if self.behavior is None and "behavior" in self.model_fields_set: + _dict['behavior'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + # set to None if layer (nullable) is None + # and model_fields_set contains the field + if self.layer is None and "layer" in self.model_fields_set: + _dict['layer'] = None + + # set to None if is_flaky (nullable) is None + # and model_fields_set contains the field + if self.is_flaky is None and "is_flaky" in self.model_fields_set: + _dict['is_flaky'] = None + + # set to None if suite_id (nullable) is None + # and model_fields_set contains the field + if self.suite_id is None and "suite_id" in self.model_fields_set: + _dict['suite_id'] = None + + # set to None if milestone_id (nullable) is None + # and model_fields_set contains the field + if self.milestone_id is None and "milestone_id" in self.model_fields_set: + _dict['milestone_id'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = 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 + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewCaseData 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"), + "description": obj.get("description"), + "preconditions": obj.get("preconditions"), + "postconditions": obj.get("postconditions"), + "severity": obj.get("severity"), + "priority": obj.get("priority"), + "behavior": obj.get("behavior"), + "type": obj.get("type"), + "layer": obj.get("layer"), + "is_flaky": obj.get("is_flaky"), + "is_muted": obj.get("is_muted"), + "suite_id": obj.get("suite_id"), + "milestone_id": obj.get("milestone_id"), + "is_manual": obj.get("is_manual"), + "is_to_be_automated": obj.get("is_to_be_automated"), + "status": obj.get("status"), + "steps_type": obj.get("steps_type"), + "attachments": obj.get("attachments"), + "steps": [ReviewStepData.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, + "tags": obj.get("tags"), + "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/review_create.py b/qase-api-client/src/qase/api_client_v1/models/review_create.py new file mode 100644 index 00000000..4418c187 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_create.py @@ -0,0 +1,103 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from uuid import UUID +from qase.api_client_v1.models.review_case_data import ReviewCaseData +from typing import Optional, Set +from typing_extensions import Self + +class ReviewCreate(BaseModel): + """ + ReviewCreate + """ # noqa: E501 + case_id: Optional[StrictInt] = Field(default=None, description="ID of the reviewed test case. When present an `edit` review is created, otherwise a `create` review with a new-case draft.") + reviewers: Optional[Annotated[List[UUID], Field(max_length=20)]] = Field(default=None, description="Author UUIDs of team members to assign as reviewers (see `GET /author`).") + proposed_case: ReviewCaseData = Field(description="For `create` reviews `title` and all required project fields are required. For `edit` reviews send only the fields the proposal changes.") + __properties: ClassVar[List[str]] = ["case_id", "reviewers", "proposed_case"] + + 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 ReviewCreate 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 proposed_case + if self.proposed_case: + _dict['proposed_case'] = self.proposed_case.to_dict() + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['case_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "case_id": obj.get("case_id"), + "reviewers": obj.get("reviewers"), + "proposed_case": ReviewCaseData.from_dict(obj["proposed_case"]) if obj.get("proposed_case") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_detailed.py b/qase-api-client/src/qase/api_client_v1/models/review_detailed.py new file mode 100644 index 00000000..94315380 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_detailed.py @@ -0,0 +1,156 @@ +# 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from qase.api_client_v1.models.review_reviewers_inner import ReviewReviewersInner +from typing import Optional, Set +from typing_extensions import Self + +class ReviewDetailed(BaseModel): + """ + ReviewDetailed + """ # noqa: E501 + id: Optional[StrictInt] = Field(default=None, description="Review ID, unique within the project.") + title: Optional[StrictStr] = None + type: Optional[StrictStr] = Field(default=None, description="`create` — the review proposes a new test case; `edit` — the review proposes changes to an existing test case.") + status: Optional[StrictStr] = None + case_id: Optional[StrictInt] = Field(default=None, description="ID of the reviewed test case. Null for new-case draft reviews.") + author_uuid: Optional[UUID] = Field(default=None, description="Author UUID of the review creator (see `GET /author`).") + reviewers: Optional[List[ReviewReviewersInner]] = None + created_at: Optional[datetime] = None + updated_at: Optional[datetime] = None + proposed_case: Optional[Dict[str, Any]] = Field(default=None, description="The proposed test case state. Merging the review applies it to the test case.") + __properties: ClassVar[List[str]] = ["id", "title", "type", "status", "case_id", "author_uuid", "reviewers", "created_at", "updated_at", "proposed_case"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['create', 'edit']): + raise ValueError("must be one of enum values ('create', 'edit')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['open', 'merged', 'declined']): + raise ValueError("must be one of enum values ('open', 'merged', 'declined')") + 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 ReviewDetailed 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 reviewers (list) + _items = [] + if self.reviewers: + for _item_reviewers in self.reviewers: + if _item_reviewers: + _items.append(_item_reviewers.to_dict()) + _dict['reviewers'] = _items + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['case_id'] = None + + # set to None if author_uuid (nullable) is None + # and model_fields_set contains the field + if self.author_uuid is None and "author_uuid" in self.model_fields_set: + _dict['author_uuid'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if proposed_case (nullable) is None + # and model_fields_set contains the field + if self.proposed_case is None and "proposed_case" in self.model_fields_set: + _dict['proposed_case'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewDetailed 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"), + "status": obj.get("status"), + "case_id": obj.get("case_id"), + "author_uuid": obj.get("author_uuid"), + "reviewers": [ReviewReviewersInner.from_dict(_item) for _item in obj["reviewers"]] if obj.get("reviewers") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at"), + "proposed_case": obj.get("proposed_case") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_list_response.py b/qase-api-client/src/qase/api_client_v1/models/review_list_response.py new file mode 100644 index 00000000..388fbf42 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_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.review_list_response_all_of_result import ReviewListResponseAllOfResult +from typing import Optional, Set +from typing_extensions import Self + +class ReviewListResponse(BaseModel): + """ + ReviewListResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[ReviewListResponseAllOfResult] = 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 ReviewListResponse 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 ReviewListResponse 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": ReviewListResponseAllOfResult.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/review_list_response_all_of_result.py b/qase-api-client/src/qase/api_client_v1/models/review_list_response_all_of_result.py new file mode 100644 index 00000000..d9c380d5 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_list_response_all_of_result.py @@ -0,0 +1,102 @@ +# 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, Optional +from qase.api_client_v1.models.review import Review +from typing import Optional, Set +from typing_extensions import Self + +class ReviewListResponseAllOfResult(BaseModel): + """ + ReviewListResponseAllOfResult + """ # noqa: E501 + total: Optional[StrictInt] = None + filtered: Optional[StrictInt] = None + count: Optional[StrictInt] = None + entities: Optional[List[Review]] = None + __properties: ClassVar[List[str]] = ["total", "filtered", "count", "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 ReviewListResponseAllOfResult 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_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) + _dict['entities'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewListResponseAllOfResult 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"), + "filtered": obj.get("filtered"), + "count": obj.get("count"), + "entities": [Review.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/review_proposed_case.py b/qase-api-client/src/qase/api_client_v1/models/review_proposed_case.py new file mode 100644 index 00000000..de3aabe5 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_proposed_case.py @@ -0,0 +1,230 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from qase.api_client_v1.models.custom_field_value import CustomFieldValue +from qase.api_client_v1.models.review_proposed_step import ReviewProposedStep +from qase.api_client_v1.models.test_case_parameter import TestCaseParameter +from typing import Optional, Set +from typing_extensions import Self + +class ReviewProposedCase(BaseModel): + """ + The test case state proposed by the review. Only the fields the proposal carries are present. + """ # noqa: E501 + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + description: Optional[StrictStr] = None + preconditions: Optional[StrictStr] = None + postconditions: Optional[StrictStr] = None + severity: Optional[StrictInt] = None + priority: Optional[StrictInt] = None + behavior: Optional[StrictInt] = None + type: Optional[StrictInt] = None + layer: Optional[StrictInt] = None + is_flaky: Optional[StrictInt] = None + is_muted: Optional[StrictBool] = None + suite_id: Optional[StrictInt] = None + milestone_id: Optional[StrictInt] = None + is_manual: Optional[StrictBool] = Field(default=None, description="`true` if the case is manual, `false` if it is automated.") + is_to_be_automated: Optional[StrictBool] = Field(default=None, description="`true` if a manual case is planned to be automated.") + status: Optional[StrictInt] = None + steps_type: Optional[StrictStr] = None + attachments: Optional[List[StrictStr]] = Field(default=None, description="Attachment hashes.") + steps: Optional[List[ReviewProposedStep]] = None + tags: Optional[List[StrictStr]] = None + parameters: Optional[List[TestCaseParameter]] = None + custom_fields: Optional[List[CustomFieldValue]] = None + __properties: ClassVar[List[str]] = ["title", "description", "preconditions", "postconditions", "severity", "priority", "behavior", "type", "layer", "is_flaky", "is_muted", "suite_id", "milestone_id", "is_manual", "is_to_be_automated", "status", "steps_type", "attachments", "steps", "tags", "parameters", "custom_fields"] + + @field_validator('steps_type') + def steps_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['classic', 'gherkin']): + raise ValueError("must be one of enum values ('classic', 'gherkin')") + 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 ReviewProposedCase 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 steps (list) + _items = [] + if self.steps: + for _item_steps in self.steps: + if _item_steps: + _items.append(_item_steps.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_parameters in self.parameters: + if _item_parameters: + _items.append(_item_parameters.to_dict()) + _dict['parameters'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in custom_fields (list) + _items = [] + if self.custom_fields: + for _item_custom_fields in self.custom_fields: + if _item_custom_fields: + _items.append(_item_custom_fields.to_dict()) + _dict['custom_fields'] = _items + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if preconditions (nullable) is None + # and model_fields_set contains the field + if self.preconditions is None and "preconditions" in self.model_fields_set: + _dict['preconditions'] = None + + # set to None if postconditions (nullable) is None + # and model_fields_set contains the field + if self.postconditions is None and "postconditions" in self.model_fields_set: + _dict['postconditions'] = None + + # set to None if severity (nullable) is None + # and model_fields_set contains the field + if self.severity is None and "severity" in self.model_fields_set: + _dict['severity'] = None + + # set to None if priority (nullable) is None + # and model_fields_set contains the field + if self.priority is None and "priority" in self.model_fields_set: + _dict['priority'] = None + + # set to None if behavior (nullable) is None + # and model_fields_set contains the field + if self.behavior is None and "behavior" in self.model_fields_set: + _dict['behavior'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + # set to None if layer (nullable) is None + # and model_fields_set contains the field + if self.layer is None and "layer" in self.model_fields_set: + _dict['layer'] = None + + # set to None if is_flaky (nullable) is None + # and model_fields_set contains the field + if self.is_flaky is None and "is_flaky" in self.model_fields_set: + _dict['is_flaky'] = None + + # set to None if suite_id (nullable) is None + # and model_fields_set contains the field + if self.suite_id is None and "suite_id" in self.model_fields_set: + _dict['suite_id'] = None + + # set to None if milestone_id (nullable) is None + # and model_fields_set contains the field + if self.milestone_id is None and "milestone_id" in self.model_fields_set: + _dict['milestone_id'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if tags (nullable) is None + # and model_fields_set contains the field + if self.tags is None and "tags" in self.model_fields_set: + _dict['tags'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewProposedCase 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"), + "description": obj.get("description"), + "preconditions": obj.get("preconditions"), + "postconditions": obj.get("postconditions"), + "severity": obj.get("severity"), + "priority": obj.get("priority"), + "behavior": obj.get("behavior"), + "type": obj.get("type"), + "layer": obj.get("layer"), + "is_flaky": obj.get("is_flaky"), + "is_muted": obj.get("is_muted"), + "suite_id": obj.get("suite_id"), + "milestone_id": obj.get("milestone_id"), + "is_manual": obj.get("is_manual"), + "is_to_be_automated": obj.get("is_to_be_automated"), + "status": obj.get("status"), + "steps_type": obj.get("steps_type"), + "attachments": obj.get("attachments"), + "steps": [ReviewProposedStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, + "tags": obj.get("tags"), + "parameters": [TestCaseParameter.from_dict(_item) for _item in obj["parameters"]] if obj.get("parameters") is not None else None, + "custom_fields": [CustomFieldValue.from_dict(_item) for _item in obj["custom_fields"]] if obj.get("custom_fields") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_proposed_step.py b/qase-api-client/src/qase/api_client_v1/models/review_proposed_step.py new file mode 100644 index 00000000..d8f87ae8 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_proposed_step.py @@ -0,0 +1,100 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReviewProposedStep(BaseModel): + """ + ReviewProposedStep + """ # noqa: E501 + action: Optional[StrictStr] = Field(default=None, description="Step action text. Used for classic steps. For gherkin steps, use the \"value\" property instead.") + expected_result: Optional[StrictStr] = None + data: Optional[StrictStr] = None + value: Optional[StrictStr] = Field(default=None, description="Gherkin scenario text. Used when steps_type is \"gherkin\".") + shared: Optional[StrictStr] = Field(default=None, description="Hash of the referenced shared step.") + attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") + steps: Optional[List[Dict[str, Any]]] = Field(default=None, description="Nested steps use the same structure.") + __properties: ClassVar[List[str]] = ["action", "expected_result", "data", "value", "shared", "attachments", "steps"] + + 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 ReviewProposedStep 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 ReviewProposedStep from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "action": obj.get("action"), + "expected_result": obj.get("expected_result"), + "data": obj.get("data"), + "value": obj.get("value"), + "shared": obj.get("shared"), + "attachments": obj.get("attachments"), + "steps": obj.get("steps") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_response.py b/qase-api-client/src/qase/api_client_v1/models/review_response.py new file mode 100644 index 00000000..3001ef8f --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_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.review_detailed import ReviewDetailed +from typing import Optional, Set +from typing_extensions import Self + +class ReviewResponse(BaseModel): + """ + ReviewResponse + """ # noqa: E501 + status: Optional[StrictBool] = None + result: Optional[ReviewDetailed] = 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 ReviewResponse 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 ReviewResponse 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": ReviewDetailed.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/review_reviewers_inner.py b/qase-api-client/src/qase/api_client_v1/models/review_reviewers_inner.py new file mode 100644 index 00000000..57172230 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_reviewers_inner.py @@ -0,0 +1,106 @@ +# 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, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self + +class ReviewReviewersInner(BaseModel): + """ + ReviewReviewersInner + """ # noqa: E501 + author_uuid: Optional[UUID] = Field(default=None, description="Author UUID of the reviewer (see `GET /author`).") + status: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["author_uuid", "status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['unapproved', 'approved', 'changes_requested']): + raise ValueError("must be one of enum values ('unapproved', 'approved', 'changes_requested')") + 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 ReviewReviewersInner 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 author_uuid (nullable) is None + # and model_fields_set contains the field + if self.author_uuid is None and "author_uuid" in self.model_fields_set: + _dict['author_uuid'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewReviewersInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "author_uuid": obj.get("author_uuid"), + "status": obj.get("status") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_step_data.py b/qase-api-client/src/qase/api_client_v1/models/review_step_data.py new file mode 100644 index 00000000..6ef34f13 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_step_data.py @@ -0,0 +1,100 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReviewStepData(BaseModel): + """ + A step of the proposed test case. When `steps_type` is `gherkin` the step carries the scenario in `value` and nothing else: a non-empty `action`, `expected_result`, `data`, `attachments`, `shared` or nested `steps` is rejected. + """ # noqa: E501 + action: Optional[StrictStr] = Field(default=None, description="Step action text. Classic steps only.") + shared: Optional[StrictStr] = Field(default=None, description="Hash of an existing shared step to insert at this position.") + expected_result: Optional[StrictStr] = None + data: Optional[StrictStr] = None + value: Optional[StrictStr] = Field(default=None, description="Gherkin scenario text. Used when steps_type is \"gherkin\". Example: \"Given a user exists\\nWhen they log in\\nThen they see the dashboard\"") + attachments: Optional[List[StrictStr]] = Field(default=None, description="A list of Attachment hashes.") + steps: Optional[List[Dict[str, Any]]] = Field(default=None, description="Nested steps may be passed here. Use same structure for them.") + __properties: ClassVar[List[str]] = ["action", "shared", "expected_result", "data", "value", "attachments", "steps"] + + 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 ReviewStepData 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 ReviewStepData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "action": obj.get("action"), + "shared": obj.get("shared"), + "expected_result": obj.get("expected_result"), + "data": obj.get("data"), + "value": obj.get("value"), + "attachments": obj.get("attachments"), + "steps": obj.get("steps") + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/review_update.py b/qase-api-client/src/qase/api_client_v1/models/review_update.py new file mode 100644 index 00000000..a120ba23 --- /dev/null +++ b/qase-api-client/src/qase/api_client_v1/models/review_update.py @@ -0,0 +1,96 @@ +# 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, Optional +from typing_extensions import Annotated +from uuid import UUID +from qase.api_client_v1.models.review_case_data import ReviewCaseData +from typing import Optional, Set +from typing_extensions import Self + +class ReviewUpdate(BaseModel): + """ + ReviewUpdate + """ # noqa: E501 + reviewers: Optional[Annotated[List[UUID], Field(max_length=20)]] = Field(default=None, description="Author UUIDs of team members assigned as reviewers (see `GET /author`). When provided, replaces the current reviewer list; an empty array removes all reviewers. Omit to leave reviewers unchanged.") + proposed_case: Optional[ReviewCaseData] = Field(default=None, description="Sent fields are merged into the stored proposal. Changing the proposal resets all existing approvals; updating only the reviewers keeps them.") + __properties: ClassVar[List[str]] = ["reviewers", "proposed_case"] + + 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 ReviewUpdate 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 proposed_case + if self.proposed_case: + _dict['proposed_case'] = self.proposed_case.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReviewUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "reviewers": obj.get("reviewers"), + "proposed_case": ReviewCaseData.from_dict(obj["proposed_case"]) if obj.get("proposed_case") is not None else None + }) + return _obj + + diff --git a/qase-api-client/src/qase/api_client_v1/models/test_step_create.py b/qase-api-client/src/qase/api_client_v1/models/test_step_create.py index cb0e2561..bee5b54e 100644 --- a/qase-api-client/src/qase/api_client_v1/models/test_step_create.py +++ b/qase-api-client/src/qase/api_client_v1/models/test_step_create.py @@ -25,7 +25,7 @@ class TestStepCreate(BaseModel): """ - TestStepCreate + When `steps_type` is `gherkin` only the scenario text is read from a step. A non-empty `expected_result`, `data`, `attachments`, `shared` or nested `steps` is rejected, and so is sending the scenario in `value` and `action` at once. """ # noqa: E501 action: Optional[StrictStr] = Field(default=None, description="Step action text. Used for classic steps. For gherkin steps, use the \"value\" property instead.") shared: Optional[StrictStr] = Field(default=None, description="Hash of an existing shared step to insert at this position.")