Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions qase-api-client/docs/RunCreate.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Name | Type | Description | Notes
**custom_field** | **Dict[str, str]** | A map of custom fields values (id => value) | [optional]
**start_time** | **str** | | [optional]
**end_time** | **str** | | [optional]
**is_cloud** | **bool** | Indicates if the run is created for the Test Cases produced by AIDEN | [optional]
**cloud_run_config** | [**RunCreateCloudRunConfig**](RunCreateCloudRunConfig.md) | | [optional]

## Example

Expand Down
30 changes: 30 additions & 0 deletions qase-api-client/docs/RunCreateCloudRunConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# RunCreateCloudRunConfig

Configuration for the cloud run, if applicable

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**browser** | **str** | The browser to be used for the cloud run | [optional]

## Example

```python
from qase.api_client_v1.models.run_create_cloud_run_config import RunCreateCloudRunConfig

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

# convert the object into a dict
run_create_cloud_run_config_dict = run_create_cloud_run_config_instance.to_dict()
# create an instance of RunCreateCloudRunConfig from a dict
run_create_cloud_run_config_form_dict = run_create_cloud_run_config.from_dict(run_create_cloud_run_config_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion qase-api-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-client"
version = "1.2.3"
version = "1.2.4"
description = "Qase TestOps API V1 client for Python"
readme = "README.md"
authors = [{name = "Qase Team", email = "support@qase.io"}]
Expand Down
1 change: 1 addition & 0 deletions qase-api-client/src/qase/api_client_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
from qase.api_client_v1.models.resultcreate_bulk import ResultcreateBulk
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
from qase.api_client_v1.models.run_environment import RunEnvironment
from qase.api_client_v1.models.run_external_issue import RunExternalIssue
from qase.api_client_v1.models.run_list_response import RunListResponse
Expand Down
1 change: 1 addition & 0 deletions qase-api-client/src/qase/api_client_v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
from qase.api_client_v1.models.resultcreate_bulk import ResultcreateBulk
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
from qase.api_client_v1.models.run_environment import RunEnvironment
from qase.api_client_v1.models.run_external_issue import RunExternalIssue
from qase.api_client_v1.models.run_list_response import RunListResponse
Expand Down
12 changes: 10 additions & 2 deletions qase-api-client/src/qase/api_client_v1/models/run_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from qase.api_client_v1.models.run_create_cloud_run_config import RunCreateCloudRunConfig
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -43,7 +44,9 @@ class RunCreate(BaseModel):
custom_field: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of custom fields values (id => value)")
start_time: Optional[StrictStr] = None
end_time: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["title", "description", "include_all_cases", "cases", "is_autotest", "environment_id", "environment_slug", "milestone_id", "plan_id", "author_id", "tags", "configurations", "custom_field", "start_time", "end_time"]
is_cloud: Optional[StrictBool] = Field(default=None, description="Indicates if the run is created for the Test Cases produced by AIDEN")
cloud_run_config: Optional[RunCreateCloudRunConfig] = None
__properties: ClassVar[List[str]] = ["title", "description", "include_all_cases", "cases", "is_autotest", "environment_id", "environment_slug", "milestone_id", "plan_id", "author_id", "tags", "configurations", "custom_field", "start_time", "end_time", "is_cloud", "cloud_run_config"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -84,6 +87,9 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of cloud_run_config
if self.cloud_run_config:
_dict['cloud_run_config'] = self.cloud_run_config.to_dict()
return _dict

@classmethod
Expand All @@ -110,7 +116,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"configurations": obj.get("configurations"),
"custom_field": obj.get("custom_field"),
"start_time": obj.get("start_time"),
"end_time": obj.get("end_time")
"end_time": obj.get("end_time"),
"is_cloud": obj.get("is_cloud"),
"cloud_run_config": RunCreateCloudRunConfig.from_dict(obj["cloud_run_config"]) if obj.get("cloud_run_config") is not None else None
})
return _obj

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# coding: utf-8

"""
Qase.io TestOps API v1

Qase TestOps API v1 Specification.

The version of the OpenAPI document: 1.0.0
Contact: support@qase.io
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class RunCreateCloudRunConfig(BaseModel):
"""
Configuration for the cloud run, if applicable
""" # noqa: E501
browser: Optional[StrictStr] = Field(default=None, description="The browser to be used for the cloud run")
__properties: ClassVar[List[str]] = ["browser"]

@field_validator('browser')
def browser_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value

if value not in set(['chromium', 'firefox', 'webkit']):
raise ValueError("must be one of enum values ('chromium', 'firefox', 'webkit')")
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 RunCreateCloudRunConfig 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 RunCreateCloudRunConfig from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"browser": obj.get("browser")
})
return _obj