From d34f1be56bb86d947051ad75dbf4bee9ab991aef Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 5 Nov 2024 07:48:11 +0100 Subject: [PATCH] v5.0.1 (#55) --- README.md | 2 ++ ...tionsValidateResponseBodyRedeemablesItem.md | 2 ++ docs/ValidationsRedeemableInapplicable.md | 2 ++ docs/ValidationsRedeemableSkipped.md | 2 ++ ...tionsValidateResponseBodyRedeemablesItem.md | 2 ++ pyproject.toml | 2 +- setup.py | 2 +- voucherify/__init__.py | 2 +- voucherify/api_client.py | 4 ++-- voucherify/configuration.py | 2 +- ..._validate_response_body_redeemables_item.py | 18 ++++++++++++++++-- .../validations_redeemable_inapplicable.py | 18 ++++++++++++++++-- .../models/validations_redeemable_skipped.py | 18 ++++++++++++++++-- ..._validate_response_body_redeemables_item.py | 18 ++++++++++++++++-- 14 files changed, 80 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9ad096e..81f1e3e 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ Remember that this SDK is auto generated (except of the tests) so changes made h ## 📅 Changelog +- **2024-11-04** - `5.0.1` + - Added support for returning `campaign_id` and `campaign_name` in stackable validation endpoint, when `redeemable` option is expanded - **2024-10-28** - `5.0.0` - Added missing `enums` in few filters models - !!! BREAKING CHANGES !!! diff --git a/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md b/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md index 1e44292..605e9a4 100644 --- a/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md +++ b/docs/ClientValidationsValidateResponseBodyRedeemablesItem.md @@ -14,6 +14,8 @@ Name | Type | Description | Notes **result** | [**ClientValidationsValidateResponseBodyRedeemablesItemResult**](ClientValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional] **metadata** | **object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] **categories** | [**List[CategoryWithStackingRulesType]**](CategoryWithStackingRulesType.md) | | [optional] +**campaign_name** | **str** | Campaign name | [optional] +**campaign_id** | **str** | Unique campaign ID assigned by Voucherify. | [optional] [[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/docs/ValidationsRedeemableInapplicable.md b/docs/ValidationsRedeemableInapplicable.md index 78f20cb..f3bfa07 100644 --- a/docs/ValidationsRedeemableInapplicable.md +++ b/docs/ValidationsRedeemableInapplicable.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **result** | [**ValidationsRedeemableInapplicableResult**](ValidationsRedeemableInapplicableResult.md) | | [optional] **metadata** | **object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] **categories** | [**List[CategoryWithStackingRulesType]**](CategoryWithStackingRulesType.md) | | [optional] +**campaign_name** | **str** | Campaign name | [optional] +**campaign_id** | **str** | Unique campaign ID assigned by Voucherify. | [optional] [[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/docs/ValidationsRedeemableSkipped.md b/docs/ValidationsRedeemableSkipped.md index 96a9a1a..1e6526c 100644 --- a/docs/ValidationsRedeemableSkipped.md +++ b/docs/ValidationsRedeemableSkipped.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **result** | [**ValidationsRedeemableSkippedResult**](ValidationsRedeemableSkippedResult.md) | | [optional] **metadata** | **object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] **categories** | [**List[CategoryWithStackingRulesType]**](CategoryWithStackingRulesType.md) | | [optional] +**campaign_name** | **str** | Campaign name | [optional] +**campaign_id** | **str** | Unique campaign ID assigned by Voucherify. | [optional] [[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/docs/ValidationsValidateResponseBodyRedeemablesItem.md b/docs/ValidationsValidateResponseBodyRedeemablesItem.md index 481b374..17828fe 100644 --- a/docs/ValidationsValidateResponseBodyRedeemablesItem.md +++ b/docs/ValidationsValidateResponseBodyRedeemablesItem.md @@ -14,6 +14,8 @@ Name | Type | Description | Notes **result** | [**ValidationsValidateResponseBodyRedeemablesItemResult**](ValidationsValidateResponseBodyRedeemablesItemResult.md) | | [optional] **metadata** | **object** | The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable. | [optional] **categories** | [**List[CategoryWithStackingRulesType]**](CategoryWithStackingRulesType.md) | | [optional] +**campaign_name** | **str** | Campaign name | [optional] +**campaign_id** | **str** | Unique campaign ID assigned by Voucherify. | [optional] [[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/pyproject.toml b/pyproject.toml index e14cf28..aede682 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voucherify" -version = "5.0.0" +version = "5.0.1" description = "Voucherify API" authors = ["Voucherify Team "] license = "MIT" diff --git a/setup.py b/setup.py index 71f63b5..1691b7a 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "voucherify" -VERSION = "5.0.0" +VERSION = "5.0.1" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0", diff --git a/voucherify/__init__.py b/voucherify/__init__.py index 268e776..1decd39 100644 --- a/voucherify/__init__.py +++ b/voucherify/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "5.0.0" +__version__ = "5.0.1" # import apis into sdk package from voucherify.api.async_actions_api import AsyncActionsApi diff --git a/voucherify/api_client.py b/voucherify/api_client.py index 06e5bd4..a8a3000 100644 --- a/voucherify/api_client.py +++ b/voucherify/api_client.py @@ -88,13 +88,13 @@ def __init__( self.rest_client = rest.RESTClientObject(configuration) self.default_headers = { "X-Voucherify-Channel": "Python-SDK", - "User-Agent": "OpenAPI-Python-SDK/5.0.0" + "User-Agent": "OpenAPI-Python-SDK/5.0.1" } if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Python-SDK/5.0.0' + self.user_agent = 'OpenAPI-Python-SDK/5.0.1' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/voucherify/configuration.py b/voucherify/configuration.py index 32b3640..97613fb 100644 --- a/voucherify/configuration.py +++ b/voucherify/configuration.py @@ -459,7 +459,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v2018-08-01\n"\ - "SDK Package Version: 5.0.0".\ + "SDK Package Version: 5.0.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/voucherify/models/client_validations_validate_response_body_redeemables_item.py b/voucherify/models/client_validations_validate_response_body_redeemables_item.py index 3a96c22..55cc3f4 100644 --- a/voucherify/models/client_validations_validate_response_body_redeemables_item.py +++ b/voucherify/models/client_validations_validate_response_body_redeemables_item.py @@ -41,7 +41,9 @@ class ClientValidationsValidateResponseBodyRedeemablesItem(BaseModel): result: Optional[ClientValidationsValidateResponseBodyRedeemablesItemResult] = None metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.") categories: Optional[List[CategoryWithStackingRulesType]] = None - __properties: ClassVar[List[str]] = ["status", "id", "object", "order", "applicable_to", "inapplicable_to", "result", "metadata", "categories"] + campaign_name: Optional[StrictStr] = Field(default=None, description="Campaign name") + campaign_id: Optional[StrictStr] = Field(default=None, description="Unique campaign ID assigned by Voucherify.") + __properties: ClassVar[List[str]] = ["status", "id", "object", "order", "applicable_to", "inapplicable_to", "result", "metadata", "categories", "campaign_name", "campaign_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -141,6 +143,16 @@ def to_dict(self) -> Dict[str, Any]: if self.categories is None and "categories" in self.model_fields_set: _dict['categories'] = None + # set to None if campaign_name (nullable) is None + # and model_fields_set contains the field + if self.campaign_name is None and "campaign_name" in self.model_fields_set: + _dict['campaign_name'] = None + + # set to None if campaign_id (nullable) is None + # and model_fields_set contains the field + if self.campaign_id is None and "campaign_id" in self.model_fields_set: + _dict['campaign_id'] = None + return _dict @classmethod @@ -161,7 +173,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "inapplicable_to": InapplicableToResultList.from_dict(obj["inapplicable_to"]) if obj.get("inapplicable_to") is not None else None, "result": ClientValidationsValidateResponseBodyRedeemablesItemResult.from_dict(obj["result"]) if obj.get("result") is not None else None, "metadata": obj.get("metadata"), - "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None + "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, + "campaign_name": obj.get("campaign_name"), + "campaign_id": obj.get("campaign_id") }) return _obj diff --git a/voucherify/models/validations_redeemable_inapplicable.py b/voucherify/models/validations_redeemable_inapplicable.py index e5edf2d..e61e1b6 100644 --- a/voucherify/models/validations_redeemable_inapplicable.py +++ b/voucherify/models/validations_redeemable_inapplicable.py @@ -35,7 +35,9 @@ class ValidationsRedeemableInapplicable(BaseModel): result: Optional[ValidationsRedeemableInapplicableResult] = None metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.") categories: Optional[List[CategoryWithStackingRulesType]] = None - __properties: ClassVar[List[str]] = ["status", "id", "object", "result", "metadata", "categories"] + campaign_name: Optional[StrictStr] = Field(default=None, description="Campaign name") + campaign_id: Optional[StrictStr] = Field(default=None, description="Unique campaign ID assigned by Voucherify.") + __properties: ClassVar[List[str]] = ["status", "id", "object", "result", "metadata", "categories", "campaign_name", "campaign_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -136,6 +138,16 @@ def to_dict(self) -> Dict[str, Any]: if self.categories is None and "categories" in self.model_fields_set: _dict['categories'] = None + # set to None if campaign_name (nullable) is None + # and model_fields_set contains the field + if self.campaign_name is None and "campaign_name" in self.model_fields_set: + _dict['campaign_name'] = None + + # set to None if campaign_id (nullable) is None + # and model_fields_set contains the field + if self.campaign_id is None and "campaign_id" in self.model_fields_set: + _dict['campaign_id'] = None + return _dict @classmethod @@ -153,7 +165,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "object": obj.get("object"), "result": ValidationsRedeemableInapplicableResult.from_dict(obj["result"]) if obj.get("result") is not None else None, "metadata": obj.get("metadata"), - "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None + "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, + "campaign_name": obj.get("campaign_name"), + "campaign_id": obj.get("campaign_id") }) return _obj diff --git a/voucherify/models/validations_redeemable_skipped.py b/voucherify/models/validations_redeemable_skipped.py index 5cee67b..269a9d8 100644 --- a/voucherify/models/validations_redeemable_skipped.py +++ b/voucherify/models/validations_redeemable_skipped.py @@ -35,7 +35,9 @@ class ValidationsRedeemableSkipped(BaseModel): result: Optional[ValidationsRedeemableSkippedResult] = None metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.") categories: Optional[List[CategoryWithStackingRulesType]] = None - __properties: ClassVar[List[str]] = ["status", "id", "object", "result", "metadata", "categories"] + campaign_name: Optional[StrictStr] = Field(default=None, description="Campaign name") + campaign_id: Optional[StrictStr] = Field(default=None, description="Unique campaign ID assigned by Voucherify.") + __properties: ClassVar[List[str]] = ["status", "id", "object", "result", "metadata", "categories", "campaign_name", "campaign_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -136,6 +138,16 @@ def to_dict(self) -> Dict[str, Any]: if self.categories is None and "categories" in self.model_fields_set: _dict['categories'] = None + # set to None if campaign_name (nullable) is None + # and model_fields_set contains the field + if self.campaign_name is None and "campaign_name" in self.model_fields_set: + _dict['campaign_name'] = None + + # set to None if campaign_id (nullable) is None + # and model_fields_set contains the field + if self.campaign_id is None and "campaign_id" in self.model_fields_set: + _dict['campaign_id'] = None + return _dict @classmethod @@ -153,7 +165,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "object": obj.get("object"), "result": ValidationsRedeemableSkippedResult.from_dict(obj["result"]) if obj.get("result") is not None else None, "metadata": obj.get("metadata"), - "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None + "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, + "campaign_name": obj.get("campaign_name"), + "campaign_id": obj.get("campaign_id") }) return _obj diff --git a/voucherify/models/validations_validate_response_body_redeemables_item.py b/voucherify/models/validations_validate_response_body_redeemables_item.py index 811f57c..caf2b7c 100644 --- a/voucherify/models/validations_validate_response_body_redeemables_item.py +++ b/voucherify/models/validations_validate_response_body_redeemables_item.py @@ -41,7 +41,9 @@ class ValidationsValidateResponseBodyRedeemablesItem(BaseModel): result: Optional[ValidationsValidateResponseBodyRedeemablesItemResult] = None metadata: Optional[Dict[str, Any]] = Field(default=None, description="The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable.") categories: Optional[List[CategoryWithStackingRulesType]] = None - __properties: ClassVar[List[str]] = ["status", "id", "object", "order", "applicable_to", "inapplicable_to", "result", "metadata", "categories"] + campaign_name: Optional[StrictStr] = Field(default=None, description="Campaign name") + campaign_id: Optional[StrictStr] = Field(default=None, description="Unique campaign ID assigned by Voucherify.") + __properties: ClassVar[List[str]] = ["status", "id", "object", "order", "applicable_to", "inapplicable_to", "result", "metadata", "categories", "campaign_name", "campaign_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -141,6 +143,16 @@ def to_dict(self) -> Dict[str, Any]: if self.categories is None and "categories" in self.model_fields_set: _dict['categories'] = None + # set to None if campaign_name (nullable) is None + # and model_fields_set contains the field + if self.campaign_name is None and "campaign_name" in self.model_fields_set: + _dict['campaign_name'] = None + + # set to None if campaign_id (nullable) is None + # and model_fields_set contains the field + if self.campaign_id is None and "campaign_id" in self.model_fields_set: + _dict['campaign_id'] = None + return _dict @classmethod @@ -161,7 +173,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "inapplicable_to": InapplicableToResultList.from_dict(obj["inapplicable_to"]) if obj.get("inapplicable_to") is not None else None, "result": ValidationsValidateResponseBodyRedeemablesItemResult.from_dict(obj["result"]) if obj.get("result") is not None else None, "metadata": obj.get("metadata"), - "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None + "categories": [CategoryWithStackingRulesType.from_dict(_item) for _item in obj["categories"]] if obj.get("categories") is not None else None, + "campaign_name": obj.get("campaign_name"), + "campaign_id": obj.get("campaign_id") }) return _obj