Skip to content

Commit d81f27e

Browse files
algolia-bottecu23
andcommitted
fix(specs): update currency validation rules (generated)
algolia/api-clients-automation#5890 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Andrei Teculescu <74561515+tecu23@users.noreply.github.com>
1 parent 97ec5a9 commit d81f27e

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

algoliasearch/insights/models/added_to_cart_object_ids.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ def authenticated_user_token_validate_regular_expression(cls, value):
9898
)
9999
return value
100100

101+
@field_validator("currency")
102+
def currency_validate_regular_expression(cls, value):
103+
"""Validates the regular expression"""
104+
if value is None:
105+
return value
106+
107+
if not match(r"^[A-Za-z]{3}$", value):
108+
raise ValueError(r"must validate the regular expression /^[A-Za-z]{3}$/")
109+
return value
110+
101111
model_config = ConfigDict(
102112
strict=False,
103113
use_enum_values=True,

algoliasearch/insights/models/added_to_cart_object_ids_after_search.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def authenticated_user_token_validate_regular_expression(cls, value):
108108
)
109109
return value
110110

111+
@field_validator("currency")
112+
def currency_validate_regular_expression(cls, value):
113+
"""Validates the regular expression"""
114+
if value is None:
115+
return value
116+
117+
if not match(r"^[A-Za-z]{3}$", value):
118+
raise ValueError(r"must validate the regular expression /^[A-Za-z]{3}$/")
119+
return value
120+
111121
model_config = ConfigDict(
112122
strict=False,
113123
use_enum_values=True,

algoliasearch/insights/models/purchased_object_ids.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ def authenticated_user_token_validate_regular_expression(cls, value):
9898
)
9999
return value
100100

101+
@field_validator("currency")
102+
def currency_validate_regular_expression(cls, value):
103+
"""Validates the regular expression"""
104+
if value is None:
105+
return value
106+
107+
if not match(r"^[A-Za-z]{3}$", value):
108+
raise ValueError(r"must validate the regular expression /^[A-Za-z]{3}$/")
109+
return value
110+
101111
model_config = ConfigDict(
102112
strict=False,
103113
use_enum_values=True,

algoliasearch/insights/models/purchased_object_ids_after_search.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ def authenticated_user_token_validate_regular_expression(cls, value):
9898
)
9999
return value
100100

101+
@field_validator("currency")
102+
def currency_validate_regular_expression(cls, value):
103+
"""Validates the regular expression"""
104+
if value is None:
105+
return value
106+
107+
if not match(r"^[A-Za-z]{3}$", value):
108+
raise ValueError(r"must validate the regular expression /^[A-Za-z]{3}$/")
109+
return value
110+
101111
model_config = ConfigDict(
102112
strict=False,
103113
use_enum_values=True,

0 commit comments

Comments
 (0)