Skip to content

Commit

Permalink
update to 7.0.1 to fix optional-budget issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Neokil committed Jan 24, 2025
1 parent 5178d50 commit 69869b3
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/AdditionalCampaignProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**budgets** | [**list[CampaignBudget]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. |
**budgets** | [**list[CampaignBudget]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. | [optional]
**coupon_redemption_count** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. | [optional]
**referral_redemption_count** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. | [optional]
**discount_count** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/Campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Name | Type | Description | Notes
**campaign_groups** | **list[int]** | The IDs of the [campaign groups](https://docs.talon.one/docs/product/account/managing-campaign-groups) this campaign belongs to. | [optional]
**type** | **str** | The campaign type. Possible type values: - `cartItem`: Type of campaign that can apply effects only to cart items. - `advanced`: Type of campaign that can apply effects to customer sessions and cart items. | [default to 'advanced']
**linked_store_ids** | **list[int]** | A list of store IDs that you want to link to the campaign. **Note:** Campaigns with linked store IDs will only be evaluated when there is a [customer session update](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) that references a linked store. | [optional]
**budgets** | [**list[CampaignBudget]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. |
**budgets** | [**list[CampaignBudget]**](CampaignBudget.md) | A list of all the budgets that are defined by this campaign and their usage. **Note:** Budgets that are not defined do not appear in this list and their usage is not counted until they are defined. | [optional]
**coupon_redemption_count** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of coupons redeemed in the campaign. | [optional]
**referral_redemption_count** | **int** | This property is **deprecated**. The count should be available under *budgets* property. Number of referral codes redeemed in the campaign. | [optional]
**discount_count** | **float** | This property is **deprecated**. The count should be available under *budgets* property. Total amount of discounts redeemed in the campaign. | [optional]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# http://pypi.python.org/pypi/setuptools

NAME = "talon-one-python-sdk"
VERSION = "7.0.0"
VERSION = "7.0.1"

# Get the long description from the README.md file
here = pathlib.Path(__file__).parent.resolve()
Expand Down
2 changes: 1 addition & 1 deletion talon_one/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import absolute_import

__version__ = "7.0.0"
__version__ = "7.0.1"

# import apis into sdk package
from talon_one.api.integration_api import IntegrationApi
Expand Down
2 changes: 1 addition & 1 deletion talon_one/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/7.0.0/python'
self.user_agent = 'OpenAPI-Generator/7.0.1/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion talon_one/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: \n"\
"SDK Package Version: 7.0.0".\
"SDK Package Version: 7.0.1".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
5 changes: 2 additions & 3 deletions talon_one/models/additional_campaign_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def __init__(self, budgets=None, coupon_redemption_count=None, referral_redempti
self._stores_imported = None
self.discriminator = None

self.budgets = budgets
if budgets is not None:
self.budgets = budgets
if coupon_redemption_count is not None:
self.coupon_redemption_count = coupon_redemption_count
if referral_redemption_count is not None:
Expand Down Expand Up @@ -179,8 +180,6 @@ def budgets(self, budgets):
:param budgets: The budgets of this AdditionalCampaignProperties. # noqa: E501
:type: list[CampaignBudget]
"""
if self.local_vars_configuration.client_side_validation and budgets is None: # noqa: E501
raise ValueError("Invalid value for `budgets`, must not be `None`") # noqa: E501

self._budgets = budgets

Expand Down
5 changes: 2 additions & 3 deletions talon_one/models/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ def __init__(self, id=None, created=None, application_id=None, user_id=None, nam
self.type = type
if linked_store_ids is not None:
self.linked_store_ids = linked_store_ids
self.budgets = budgets
if budgets is not None:
self.budgets = budgets
if coupon_redemption_count is not None:
self.coupon_redemption_count = coupon_redemption_count
if referral_redemption_count is not None:
Expand Down Expand Up @@ -776,8 +777,6 @@ def budgets(self, budgets):
:param budgets: The budgets of this Campaign. # noqa: E501
:type: list[CampaignBudget]
"""
if self.local_vars_configuration.client_side_validation and budgets is None: # noqa: E501
raise ValueError("Invalid value for `budgets`, must not be `None`") # noqa: E501

self._budgets = budgets

Expand Down
6 changes: 0 additions & 6 deletions test/test_additional_campaign_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ def make_instance(self, include_optional):
)
else :
return AdditionalCampaignProperties(
budgets = [
talon_one.models.campaign_budget.CampaignBudget(
action = 'createCoupon',
limit = 1000.0,
counter = 42.0, )
],
frontend_state = 'running',
stores_imported = True,
)
Expand Down
6 changes: 0 additions & 6 deletions test/test_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ def make_instance(self, include_optional):
entities = [Coupon], )
],
type = 'advanced',
budgets = [
talon_one.models.campaign_budget.CampaignBudget(
action = 'createCoupon',
limit = 1000.0,
counter = 42.0, )
],
frontend_state = 'running',
stores_imported = True,
)
Expand Down

0 comments on commit 69869b3

Please sign in to comment.