Skip to content

Commit

Permalink
feature: update v2 client
Browse files Browse the repository at this point in the history
Update contracts of the API v2 handlers
  • Loading branch information
gibiw committed Oct 29, 2024
1 parent ec0b123 commit 780e2ba
Show file tree
Hide file tree
Showing 25 changed files with 282 additions and 76 deletions.
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/BaseErrorFieldResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
## Example

```python
from qase.api_clinet_v2.models import BaseErrorFieldResponse
from qase.api_client_v2.models.base_error_field_response import BaseErrorFieldResponse

# TODO update the JSON string below
json = "{}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
## Example

```python
from src import BaseErrorFieldResponseErrorFieldsInner
from qase.api_client_v2.models.base_error_field_response_error_fields_inner import BaseErrorFieldResponseErrorFieldsInner

# TODO update the JSON string below
json = "{}"
Expand All @@ -23,8 +23,7 @@ print(BaseErrorFieldResponseErrorFieldsInner.to_json())
# convert the object into a dict
base_error_field_response_error_fields_inner_dict = base_error_field_response_error_fields_inner_instance.to_dict()
# create an instance of BaseErrorFieldResponseErrorFieldsInner from a dict
base_error_field_response_error_fields_inner_form_dict = base_error_field_response_error_fields_inner.from_dict(
base_error_field_response_error_fields_inner_dict)
base_error_field_response_error_fields_inner_form_dict = base_error_field_response_error_fields_inner.from_dict(base_error_field_response_error_fields_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)

Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/BaseErrorResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
## Example

```python
from src import BaseErrorResponse
from qase.api_client_v2.models.base_error_response import BaseErrorResponse

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/CreateResultV2422Response.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
## Example

```python
from src import CreateResultV2422Response
from qase.api_client_v2.models.create_result_v2422_response import CreateResultV2422Response

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/CreateResultsRequestV2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
## Example

```python
from src import CreateResultsRequestV2
from qase.api_client_v2.models.create_results_request_v2 import CreateResultsRequestV2

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/RelationSuite.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
## Example

```python
from src import RelationSuite
from qase.api_client_v2.models.relation_suite import RelationSuite

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/RelationSuiteItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
## Example

```python
from src import RelationSuiteItem
from qase.api_client_v2.models.relation_suite_item import RelationSuiteItem

# TODO update the JSON string below
json = "{}"
Expand Down
9 changes: 4 additions & 5 deletions qase-api-v2-client/docs/ResultCreate.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ Name | Type | Description | Notes
**signature** | **str** | | [optional]
**testops_id** | **int** | | [optional]
**execution** | [**ResultExecution**](ResultExecution.md) | |
**fields** | **Dict[str, str]** | | [optional]
**fields** | [**ResultCreateFields**](ResultCreateFields.md) | | [optional]
**attachments** | **List[str]** | | [optional]
**steps** | [**List[ResultStep]**](ResultStep.md) | | [optional]
**steps_type** | [**ResultStepsType**](ResultStepsType.md) | | [optional]
**params** | **Dict[str, str]** | | [optional]
**author** | **str** | | [optional]
**param_groups** | **List[List[str]]** | List parameter groups by name only. Add their values in the 'params' field | [optional]
**relations** | [**ResultRelations**](ResultRelations.md) | | [optional]
**muted** | **bool** | | [optional]
**message** | **str** | | [optional]
**created_at** | **float** | | [optional]
**defect** | **bool** | If true and the result is failed, the defect associated with the result will be created | [optional]

## Example

```python
from src import ResultCreate
from qase.api_client_v2.models.result_create import ResultCreate

# TODO update the JSON string below
json = "{}"
Expand Down
39 changes: 39 additions & 0 deletions qase-api-v2-client/docs/ResultCreateFields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ResultCreateFields


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**author** | **str** | | [optional]
**description** | **str** | | [optional]
**preconditions** | **str** | | [optional]
**postconditions** | **str** | | [optional]
**layer** | **str** | | [optional]
**severity** | **str** | | [optional]
**priority** | **str** | | [optional]
**behavior** | **str** | | [optional]
**type** | **str** | | [optional]
**muted** | **str** | | [optional]
**is_flaky** | **str** | | [optional]

## Example

```python
from qase.api_client_v2.models.result_create_fields import ResultCreateFields

# TODO update the JSON string below
json = "{}"
# create an instance of ResultCreateFields from a JSON string
result_create_fields_instance = ResultCreateFields.from_json(json)
# print the JSON string representation of the object
print(ResultCreateFields.to_json())

# convert the object into a dict
result_create_fields_dict = result_create_fields_instance.to_dict()
# create an instance of ResultCreateFields from a dict
result_create_fields_form_dict = result_create_fields.from_dict(result_create_fields_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)


8 changes: 4 additions & 4 deletions qase-api-v2-client/docs/ResultExecution.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**start_time** | **float** | | [optional]
**end_time** | **float** | | [optional]
**start_time** | **float** | Unix epoch time in seconds (whole part) and milliseconds (fractional part). | [optional]
**end_time** | **float** | Unix epoch time in seconds (whole part) and milliseconds (fractional part). | [optional]
**status** | **str** | Can have the following values passed, failed, blocked, skipped, invalid + custom statuses |
**duration** | **int** | | [optional]
**duration** | **int** | Duration of the test execution in milliseconds. | [optional]
**stacktrace** | **str** | | [optional]
**thread** | **str** | | [optional]

## Example

```python
from src import ResultExecution
from qase.api_client_v2.models.result_execution import ResultExecution

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/ResultRelations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
## Example

```python
from src import ResultRelations
from qase.api_client_v2.models.result_relations import ResultRelations

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/ResultStep.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name | Type | Description | Notes
## Example

```python
from src import ResultStep
from qase.api_client_v2.models.result_step import ResultStep

# TODO update the JSON string below
json = "{}"
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/docs/ResultStepData.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name | Type | Description | Notes
## Example

```python
from src import ResultStepData
from qase.api_client_v2.models.result_step_data import ResultStepData

# TODO update the JSON string below
json = "{}"
Expand Down
8 changes: 4 additions & 4 deletions qase-api-v2-client/docs/ResultStepExecution.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**start_time** | **float** | | [optional]
**end_time** | **float** | | [optional]
**start_time** | **float** | Unix epoch time in seconds (whole part) and milliseconds (fractional part). | [optional]
**end_time** | **float** | Unix epoch time in seconds (whole part) and milliseconds (fractional part). | [optional]
**status** | [**ResultStepStatus**](ResultStepStatus.md) | |
**duration** | **int** | | [optional]
**duration** | **int** | Duration of the test step execution in milliseconds. | [optional]
**comment** | **str** | | [optional]
**attachments** | **List[str]** | | [optional]

## Example

```python
from src import ResultStepExecution
from qase.api_client_v2.models.result_step_execution import ResultStepExecution

# TODO update the JSON string below
json = "{}"
Expand Down
42 changes: 21 additions & 21 deletions qase-api-v2-client/docs/ResultsApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# qase.ResultsApi
# qase.api_client_v2.ResultsApi

All URIs are relative to *https://api.qase.io/v2*

Expand All @@ -20,15 +20,15 @@ This method allows to create single test run result. If there is no free space
* Api Key Authentication (TokenAuth):

```python
import qase
from src import ResultCreate
from src import ApiException
import qase.api_client_v2
from qase.api_client_v2.models.result_create import ResultCreate
from qase.api_client_v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.qase.io/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = qase.Configuration(
host="https://api.qase.io/v2"
configuration = qase.api_client_v2.Configuration(
host = "https://api.qase.io/v2"
)

# The client must configure the authentication and authorization parameters
Expand All @@ -43,12 +43,12 @@ configuration.api_key['TokenAuth'] = os.environ["API_KEY"]
# configuration.api_key_prefix['TokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with qase.ApiClient(configuration) as api_client:
with qase.api_client_v2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = qase.ResultsApi(api_client)
project_code = 'project_code_example' # str |
run_id = 56 # int |
result_create = qase.ResultCreate() # ResultCreate |
api_instance = qase.api_client_v2.ResultsApi(api_client)
project_code = 'project_code_example' # str |
run_id = 56 # int |
result_create = qase.api_client_v2.ResultCreate() # ResultCreate |

try:
# (Beta) Create test run result
Expand Down Expand Up @@ -106,15 +106,15 @@ This method allows to create several test run results at once. If there is no f
* Api Key Authentication (TokenAuth):

```python
import qase
from src import CreateResultsRequestV2
from src import ApiException
import qase.api_client_v2
from qase.api_client_v2.models.create_results_request_v2 import CreateResultsRequestV2
from qase.api_client_v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.qase.io/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = qase.Configuration(
host="https://api.qase.io/v2"
configuration = qase.api_client_v2.Configuration(
host = "https://api.qase.io/v2"
)

# The client must configure the authentication and authorization parameters
Expand All @@ -129,12 +129,12 @@ configuration.api_key['TokenAuth'] = os.environ["API_KEY"]
# configuration.api_key_prefix['TokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with qase.ApiClient(configuration) as api_client:
with qase.api_client_v2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = qase.ResultsApi(api_client)
project_code = 'project_code_example' # str |
run_id = 56 # int |
create_results_request_v2 = qase.CreateResultsRequestV2() # CreateResultsRequestV2 |
api_instance = qase.api_client_v2.ResultsApi(api_client)
project_code = 'project_code_example' # str |
run_id = 56 # int |
create_results_request_v2 = qase.api_client_v2.CreateResultsRequestV2() # CreateResultsRequestV2 |

try:
# (Beta) Bulk create test run result
Expand Down
2 changes: 1 addition & 1 deletion qase-api-v2-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-api-v2-client"
version = "1.0.0"
version = "1.1.0"
description = "Qase TestOps API V2 client for Python"
readme = "README.md"
authors = [{name = "Qase Team", email = "[email protected]"}]
Expand Down
25 changes: 25 additions & 0 deletions qase-api-v2-client/src/qase/api_client_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,30 @@
from qase.api_client_v2.api.results_api import ResultsApi

# import ApiClient
from qase.api_client_v2.api_response import ApiResponse
from qase.api_client_v2.api_client import ApiClient
from qase.api_client_v2.configuration import Configuration
from qase.api_client_v2.exceptions import OpenApiException
from qase.api_client_v2.exceptions import ApiTypeError
from qase.api_client_v2.exceptions import ApiValueError
from qase.api_client_v2.exceptions import ApiKeyError
from qase.api_client_v2.exceptions import ApiAttributeError
from qase.api_client_v2.exceptions import ApiException

# import models into sdk package
from qase.api_client_v2.models.base_error_field_response import BaseErrorFieldResponse
from qase.api_client_v2.models.base_error_field_response_error_fields_inner import BaseErrorFieldResponseErrorFieldsInner
from qase.api_client_v2.models.base_error_response import BaseErrorResponse
from qase.api_client_v2.models.create_result_v2422_response import CreateResultV2422Response
from qase.api_client_v2.models.create_results_request_v2 import CreateResultsRequestV2
from qase.api_client_v2.models.relation_suite import RelationSuite
from qase.api_client_v2.models.relation_suite_item import RelationSuiteItem
from qase.api_client_v2.models.result_create import ResultCreate
from qase.api_client_v2.models.result_create_fields import ResultCreateFields
from qase.api_client_v2.models.result_execution import ResultExecution
from qase.api_client_v2.models.result_relations import ResultRelations
from qase.api_client_v2.models.result_step import ResultStep
from qase.api_client_v2.models.result_step_data import ResultStepData
from qase.api_client_v2.models.result_step_execution import ResultStepExecution
from qase.api_client_v2.models.result_step_status import ResultStepStatus
from qase.api_client_v2.models.result_steps_type import ResultStepsType
3 changes: 2 additions & 1 deletion qase-api-v2-client/src/qase/api_client_v2/api/results_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
Do not edit the class manually.
""" # noqa: E501

from pydantic import validate_call, Field, StrictFloat
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

Expand Down
10 changes: 8 additions & 2 deletions qase-api-v2-client/src/qase/api_client_v2/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@

from qase.api_client_v2.configuration import Configuration
from qase.api_client_v2.api_response import ApiResponse, T as ApiResponseT
import qase.api_client_v2.models
from qase.api_client_v2 import rest
from qase.api_client_v2.exceptions import (
ApiValueError,
ApiException
ApiException,
BadRequestException,
UnauthorizedException,
ForbiddenException,
NotFoundException,
ServiceException
)

RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
Expand Down Expand Up @@ -415,7 +421,7 @@ def __deserialize(self, data, klass):
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
klass = getattr(qase.models, klass)
klass = getattr(qase.api_client_v2.models, klass)

if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
Expand Down
4 changes: 2 additions & 2 deletions qase-api-v2-client/src/qase/api_client_v2/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Configuration:
You can programmatically set the cookie:
conf = qase.Configuration(
conf = qase.api_client_v2.Configuration(
api_key={'cookieAuth': 'abc123'}
api_key_prefix={'cookieAuth': 'JSESSIONID'}
)
Expand Down Expand Up @@ -130,7 +130,7 @@ def __init__(self, host=None,
self.logger = {}
"""Logging Settings
"""
self.logger["package_logger"] = logging.getLogger("qase")
self.logger["package_logger"] = logging.getLogger("qase.api_client_v2")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
"""Log format
Expand Down
Loading

0 comments on commit 780e2ba

Please sign in to comment.