|
9 | 9 | from json import loads
|
10 | 10 | from typing import Any, Dict, Optional, Self
|
11 | 11 |
|
12 |
| -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr |
| 12 | +from pydantic import BaseModel, ConfigDict, Field, StrictStr |
13 | 13 |
|
14 | 14 |
|
15 | 15 | class SourceShopify(BaseModel):
|
16 | 16 | """
|
17 | 17 | SourceShopify
|
18 | 18 | """
|
19 | 19 |
|
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", |
54 | 24 | )
|
55 | 25 | shop_url: StrictStr = Field(
|
56 | 26 | description="URL of the Shopify store.", alias="shopURL"
|
@@ -95,19 +65,6 @@ def from_dict(cls, obj: Dict) -> Self:
|
95 | 65 | return cls.model_validate(obj)
|
96 | 66 |
|
97 | 67 | _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")} |
112 | 69 | )
|
113 | 70 | return _obj
|
0 commit comments