Skip to content

Commit 04f6bc4

Browse files
algolia-botmillotp
andcommitted
chore: generated code for commit 28003717. [skip ci]
algolia/api-clients-automation@2800371 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 1a55358 commit 04f6bc4

File tree

2 files changed

+12
-99
lines changed

2 files changed

+12
-99
lines changed

algoliasearch/ingestion/models/source_shopify.py

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,18 @@
99
from json import loads
1010
from typing import Any, Dict, Optional, Self
1111

12-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
12+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
1313

1414

1515
class SourceShopify(BaseModel):
1616
"""
1717
SourceShopify
1818
"""
1919

20-
collection_id_indexing: Optional[StrictBool] = Field(
21-
default=False,
22-
description="Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false. ",
23-
alias="collectionIDIndexing",
24-
)
25-
increase_product_collection_limit: Optional[StrictBool] = Field(
26-
default=False,
27-
description="Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed. ",
28-
alias="increaseProductCollectionLimit",
29-
)
30-
default_price_ratio_as_one: Optional[StrictBool] = Field(
31-
default=True,
32-
description="Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead. ",
33-
alias="defaultPriceRatioAsOne",
34-
)
35-
exclude_oos_variants_for_price_at_trs: Optional[StrictBool] = Field(
36-
default=True,
37-
description="Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes. ",
38-
alias="excludeOOSVariantsForPriceAtTRS",
39-
)
40-
include_variants_inventory: Optional[StrictBool] = Field(
41-
default=True,
42-
description="Whether to include an inventory with every variant for every product record. ",
43-
alias="includeVariantsInventory",
44-
)
45-
has_collection_search_page: Optional[StrictBool] = Field(
46-
default=False,
47-
description="Whether to include collection IDs and handles in the product records. ",
48-
alias="hasCollectionSearchPage",
49-
)
50-
product_named_tags: Optional[StrictBool] = Field(
51-
default=False,
52-
description="Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags). ",
53-
alias="productNamedTags",
20+
feature_flags: Optional[Dict[str, Any]] = Field(
21+
default=None,
22+
description="Feature flags for the Shopify source.",
23+
alias="featureFlags",
5424
)
5525
shop_url: StrictStr = Field(
5626
description="URL of the Shopify store.", alias="shopURL"
@@ -95,19 +65,6 @@ def from_dict(cls, obj: Dict) -> Self:
9565
return cls.model_validate(obj)
9666

9767
_obj = cls.model_validate(
98-
{
99-
"collectionIDIndexing": obj.get("collectionIDIndexing"),
100-
"increaseProductCollectionLimit": obj.get(
101-
"increaseProductCollectionLimit"
102-
),
103-
"defaultPriceRatioAsOne": obj.get("defaultPriceRatioAsOne"),
104-
"excludeOOSVariantsForPriceAtTRS": obj.get(
105-
"excludeOOSVariantsForPriceAtTRS"
106-
),
107-
"includeVariantsInventory": obj.get("includeVariantsInventory"),
108-
"hasCollectionSearchPage": obj.get("hasCollectionSearchPage"),
109-
"productNamedTags": obj.get("productNamedTags"),
110-
"shopURL": obj.get("shopURL"),
111-
}
68+
{"featureFlags": obj.get("featureFlags"), "shopURL": obj.get("shopURL")}
11269
)
11370
return _obj

algoliasearch/ingestion/models/source_update_shopify.py

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,18 @@
99
from json import loads
1010
from typing import Any, Dict, Optional, Self
1111

12-
from pydantic import BaseModel, ConfigDict, Field, StrictBool
12+
from pydantic import BaseModel, ConfigDict, Field
1313

1414

1515
class SourceUpdateShopify(BaseModel):
1616
"""
1717
SourceUpdateShopify
1818
"""
1919

20-
collection_id_indexing: Optional[StrictBool] = Field(
21-
default=False,
22-
description="Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false. ",
23-
alias="collectionIDIndexing",
24-
)
25-
increase_product_collection_limit: Optional[StrictBool] = Field(
26-
default=False,
27-
description="Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed. ",
28-
alias="increaseProductCollectionLimit",
29-
)
30-
default_price_ratio_as_one: Optional[StrictBool] = Field(
31-
default=True,
32-
description="Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead. ",
33-
alias="defaultPriceRatioAsOne",
34-
)
35-
exclude_oos_variants_for_price_at_trs: Optional[StrictBool] = Field(
36-
default=True,
37-
description="Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes. ",
38-
alias="excludeOOSVariantsForPriceAtTRS",
39-
)
40-
include_variants_inventory: Optional[StrictBool] = Field(
41-
default=True,
42-
description="Whether to include an inventory with every variant for every product record. ",
43-
alias="includeVariantsInventory",
44-
)
45-
has_collection_search_page: Optional[StrictBool] = Field(
46-
default=False,
47-
description="Whether to include collection IDs and handles in the product records. ",
48-
alias="hasCollectionSearchPage",
49-
)
50-
product_named_tags: Optional[StrictBool] = Field(
51-
default=False,
52-
description="Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags). ",
53-
alias="productNamedTags",
20+
feature_flags: Optional[Dict[str, Any]] = Field(
21+
default=None,
22+
description="Feature flags for the Shopify source.",
23+
alias="featureFlags",
5424
)
5525

5626
model_config = ConfigDict(
@@ -91,19 +61,5 @@ def from_dict(cls, obj: Dict) -> Self:
9161
if not isinstance(obj, dict):
9262
return cls.model_validate(obj)
9363

94-
_obj = cls.model_validate(
95-
{
96-
"collectionIDIndexing": obj.get("collectionIDIndexing"),
97-
"increaseProductCollectionLimit": obj.get(
98-
"increaseProductCollectionLimit"
99-
),
100-
"defaultPriceRatioAsOne": obj.get("defaultPriceRatioAsOne"),
101-
"excludeOOSVariantsForPriceAtTRS": obj.get(
102-
"excludeOOSVariantsForPriceAtTRS"
103-
),
104-
"includeVariantsInventory": obj.get("includeVariantsInventory"),
105-
"hasCollectionSearchPage": obj.get("hasCollectionSearchPage"),
106-
"productNamedTags": obj.get("productNamedTags"),
107-
}
108-
)
64+
_obj = cls.model_validate({"featureFlags": obj.get("featureFlags")})
10965
return _obj

0 commit comments

Comments
 (0)