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
8 changes: 8 additions & 0 deletions qase-api-v2-client/docs/CustomFieldOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**title** | **str** | | [optional]
**slug** | **str** | | [optional]
**color** | **str** | | [optional]
**icon** | **str** | | [optional]
**is_default** | **bool** | | [optional]
**read_only** | **bool** | | [optional]
**is_active** | **bool** | | [optional]
**is_internal** | **bool** | | [optional]
**behaviour** | **int** | | [optional]

## Example

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 = "2.0.1"
version = "2.0.2"
description = "Qase TestOps API V2 client for Python"
readme = "README.md"
authors = [{name = "Qase Team", email = "support@qase.io"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
Expand All @@ -29,7 +29,15 @@ class CustomFieldOption(BaseModel):
""" # noqa: E501
id: Optional[StrictInt] = None
title: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["id", "title"]
slug: Optional[StrictStr] = None
color: Optional[StrictStr] = None
icon: Optional[StrictStr] = None
is_default: Optional[StrictBool] = None
read_only: Optional[StrictBool] = None
is_active: Optional[StrictBool] = None
is_internal: Optional[StrictBool] = None
behaviour: Optional[StrictInt] = None
__properties: ClassVar[List[str]] = ["id", "title", "slug", "color", "icon", "is_default", "read_only", "is_active", "is_internal", "behaviour"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -70,6 +78,51 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if title (nullable) is None
# and model_fields_set contains the field
if self.title is None and "title" in self.model_fields_set:
_dict['title'] = None

# set to None if slug (nullable) is None
# and model_fields_set contains the field
if self.slug is None and "slug" in self.model_fields_set:
_dict['slug'] = None

# set to None if color (nullable) is None
# and model_fields_set contains the field
if self.color is None and "color" in self.model_fields_set:
_dict['color'] = None

# set to None if icon (nullable) is None
# and model_fields_set contains the field
if self.icon is None and "icon" in self.model_fields_set:
_dict['icon'] = None

# set to None if is_default (nullable) is None
# and model_fields_set contains the field
if self.is_default is None and "is_default" in self.model_fields_set:
_dict['is_default'] = None

# set to None if read_only (nullable) is None
# and model_fields_set contains the field
if self.read_only is None and "read_only" in self.model_fields_set:
_dict['read_only'] = None

# set to None if is_active (nullable) is None
# and model_fields_set contains the field
if self.is_active is None and "is_active" in self.model_fields_set:
_dict['is_active'] = None

# set to None if is_internal (nullable) is None
# and model_fields_set contains the field
if self.is_internal is None and "is_internal" in self.model_fields_set:
_dict['is_internal'] = None

# set to None if behaviour (nullable) is None
# and model_fields_set contains the field
if self.behaviour is None and "behaviour" in self.model_fields_set:
_dict['behaviour'] = None

return _dict

@classmethod
Expand All @@ -83,7 +136,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:

_obj = cls.model_validate({
"id": obj.get("id"),
"title": obj.get("title")
"title": obj.get("title"),
"slug": obj.get("slug"),
"color": obj.get("color"),
"icon": obj.get("icon"),
"is_default": obj.get("is_default"),
"read_only": obj.get("read_only"),
"is_active": obj.get("is_active"),
"is_internal": obj.get("is_internal"),
"behaviour": obj.get("behaviour")
})
return _obj

Expand Down