Skip to content

Commit 22b71a2

Browse files
committed
[Auto Generated] 3.9.0
1 parent 5cc782e commit 22b71a2

File tree

17 files changed

+845
-35
lines changed

17 files changed

+845
-35
lines changed

CHANGELOG.md

Lines changed: 617 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Get started with the python Development SDK for Fynd Platform
1414
### Usage
1515

1616
```bash
17-
pip install "git+https://github.com/gofynd/fdk-client-python.git@3.8.0#egg=fdk_client"
17+
pip install "git+https://github.com/gofynd/fdk-client-python.git@3.9.0#egg=fdk_client"
1818
```
1919

2020
Using this method, you can `import` fdk-client-python like so:

fdk_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.8.0"
1+
__version__ = "3.9.0"

fdk_client/application/cart/client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, config: ApplicationConfig):
2626
"applyCoupon": "/service/application/cart/v1.0/coupon",
2727
"removeCoupon": "/service/application/cart/v1.0/coupon",
2828
"getBulkDiscountOffers": "/service/application/cart/v1.0/bulk-price",
29-
"applyRewardPoints": "/service/application/cart/v1.0/redeem/points/",
29+
"applyLoyaltyPoints": "/service/application/cart/v1.0/redeem",
3030
"getAddresses": "/service/application/cart/v1.0/address",
3131
"addAddress": "/service/application/cart/v1.0/address",
3232
"getAddressById": "/service/application/cart/v1.0/address/{id}",
@@ -301,7 +301,7 @@ async def updateCart(self, x_ordering_source=None, id=None, i=None, b=None, area
301301
return response
302302

303303
async def updateCartBreakup(self, x_ordering_source=None, id=None, i=None, b=None, buy_now=None, cart_type=None, body="", request_headers:Dict={}):
304-
"""Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed.
304+
"""Update cart. Customers can adjust the cart breakup by applying or removing store credits as needed.
305305
:param x-ordering-source : Ordering source header, to be used to identify source of order creation. : type
306306
:param id : The unique identifier of the cart. : type string
307307
:param i : Select `true` to retrieve all the items added in the cart. : type boolean
@@ -690,8 +690,8 @@ async def getBulkDiscountOffers(self, item_id=None, article_id=None, uid=None, s
690690

691691
return response
692692

693-
async def applyRewardPoints(self, x_ordering_source=None, id=None, i=None, b=None, buy_now=None, body="", request_headers:Dict={}):
694-
"""Users can redeem their accumulated reward points and apply them to the items in their cart, thereby availing discounts on their current purchases.
693+
async def applyLoyaltyPoints(self, x_ordering_source=None, id=None, i=None, b=None, buy_now=None, body="", request_headers:Dict={}):
694+
"""Users can redeem their accumulated loyalty points and apply them to the items in their cart, thereby availing discounts on their current purchases.
695695
:param x-ordering-source : Ordering source header, to be used to identify source of order creation. : type
696696
:param id : The unique identifier of the cart. : type string
697697
:param i : Select `true` to retrieve all the items added in the cart. : type boolean
@@ -712,15 +712,15 @@ async def applyRewardPoints(self, x_ordering_source=None, id=None, i=None, b=Non
712712
payload["buy_now"] = buy_now
713713

714714
# Parameter validation
715-
schema = CartValidator.applyRewardPoints()
715+
schema = CartValidator.applyLoyaltyPoints()
716716
schema.dump(schema.load(payload))
717717

718718
# Body validation
719-
from .models import RewardPointCreation
720-
schema = RewardPointCreation()
719+
from .models import RedeemLoyaltyPoints
720+
schema = RedeemLoyaltyPoints()
721721
schema.dump(schema.load(body))
722722

723-
url_with_params = await create_url_with_params(api_url=self._urls["applyRewardPoints"], proccessed_params="""{"required":[],"optional":[{"in":"header","name":"x-ordering-source","schema":{"$ref":"#/components/schemas/OrderingSource"},"description":"Ordering source header, to be used to identify source of order creation."},{"in":"query","name":"id","schema":{"type":"string"},"description":"The unique identifier of the cart."},{"in":"query","name":"i","schema":{"type":"boolean"},"description":"Select `true` to retrieve all the items added in the cart."},{"in":"query","name":"b","schema":{"type":"boolean"},"description":"Select `true` to retrieve the price breakup of cart items."},{"in":"query","name":"buy_now","schema":{"type":"boolean"},"description":"This is boolean to get buy_now cart."}],"query":[{"in":"query","name":"id","schema":{"type":"string"},"description":"The unique identifier of the cart."},{"in":"query","name":"i","schema":{"type":"boolean"},"description":"Select `true` to retrieve all the items added in the cart."},{"in":"query","name":"b","schema":{"type":"boolean"},"description":"Select `true` to retrieve the price breakup of cart items."},{"in":"query","name":"buy_now","schema":{"type":"boolean"},"description":"This is boolean to get buy_now cart."}],"headers":[{"in":"header","name":"x-ordering-source","schema":{"$ref":"#/components/schemas/OrderingSource"},"description":"Ordering source header, to be used to identify source of order creation."}],"path":[]}""", serverType="application", x_ordering_source=x_ordering_source, id=id, i=i, b=b, buy_now=buy_now)
723+
url_with_params = await create_url_with_params(api_url=self._urls["applyLoyaltyPoints"], proccessed_params="""{"required":[],"optional":[{"in":"header","name":"x-ordering-source","schema":{"$ref":"#/components/schemas/OrderingSource"},"description":"Ordering source header, to be used to identify source of order creation."},{"in":"query","name":"id","schema":{"type":"string"},"description":"The unique identifier of the cart."},{"in":"query","name":"i","schema":{"type":"boolean"},"description":"Select `true` to retrieve all the items added in the cart."},{"in":"query","name":"b","schema":{"type":"boolean"},"description":"Select `true` to retrieve the price breakup of cart items."},{"in":"query","name":"buy_now","schema":{"type":"boolean"},"description":"This is boolean to get buy_now cart."}],"query":[{"in":"query","name":"id","schema":{"type":"string"},"description":"The unique identifier of the cart."},{"in":"query","name":"i","schema":{"type":"boolean"},"description":"Select `true` to retrieve all the items added in the cart."},{"in":"query","name":"b","schema":{"type":"boolean"},"description":"Select `true` to retrieve the price breakup of cart items."},{"in":"query","name":"buy_now","schema":{"type":"boolean"},"description":"This is boolean to get buy_now cart."}],"headers":[{"in":"header","name":"x-ordering-source","schema":{"$ref":"#/components/schemas/OrderingSource"},"description":"Ordering source header, to be used to identify source of order creation."}],"path":[]}""", serverType="application", x_ordering_source=x_ordering_source, id=id, i=i, b=b, buy_now=buy_now)
724724
query_string = await create_query_string(id=id, i=i, b=b, buy_now=buy_now)
725725
if query_string:
726726
url_with_params += "?" + query_string
@@ -739,15 +739,15 @@ async def applyRewardPoints(self, x_ordering_source=None, id=None, i=None, b=Non
739739
if not key.startswith("x-fp-"):
740740
exclude_headers.append(key)
741741

742-
response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["applyRewardPoints"]).netloc, "post", await create_url_without_domain("/service/application/cart/v1.0/redeem/points/", x_ordering_source=x_ordering_source, id=id, i=i, b=b, buy_now=buy_now), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
742+
response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["applyLoyaltyPoints"]).netloc, "post", await create_url_without_domain("/service/application/cart/v1.0/redeem", x_ordering_source=x_ordering_source, id=id, i=i, b=b, buy_now=buy_now), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
743743

744744
if 200 <= int(response['status_code']) < 300:
745745
from .models import CartDetailResult
746746
schema = CartDetailResult()
747747
try:
748748
schema.load(response["json"])
749749
except Exception as e:
750-
print("Response Validation failed for applyRewardPoints")
750+
print("Response Validation failed for applyLoyaltyPoints")
751751
print(e)
752752

753753
return response
@@ -1704,7 +1704,7 @@ async def getPromotionPaymentOffers(self, id=None, uid=None, body="", request_he
17041704
return response
17051705

17061706
async def checkoutCartV2(self, x_ordering_source=None, buy_now=None, cart_type=None, body="", request_headers:Dict={}):
1707-
"""The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement.
1707+
"""The checkout cart initiates the order creation process based on the items in the user's cart, their selected address, and chosen payment methods. It also supports multiple payment method options and revalidates the cart details to ensure a secure and seamless order placement.
17081708
:param x-ordering-source : Ordering source header, to be used to identify source of order creation. : type
17091709
:param buy_now : This indicates the type of cart to checkout. : type boolean
17101710
:param cart_type : The type of cart. : type string

fdk_client/application/cart/models.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class BulkPriceResult(BaseSchema):
306306
pass
307307

308308

309-
class RewardPointCreation(BaseSchema):
309+
class RedeemLoyaltyPoints(BaseSchema):
310310
pass
311311

312312

@@ -1157,6 +1157,10 @@ class RawBreakup(BaseSchema):
11571157

11581158
subtotal = fields.Float(required=False)
11591159

1160+
engage_amount = fields.Float(required=False)
1161+
1162+
engage_mop_amount = fields.Float(required=False)
1163+
11601164
fynd_cash = fields.Float(required=False)
11611165

11621166
discount = fields.Float(required=False)
@@ -1229,6 +1233,22 @@ class LoyaltyPoints(BaseSchema):
12291233

12301234
is_applied = fields.Boolean(required=False)
12311235

1236+
total_points = fields.Float(required=False)
1237+
1238+
points = fields.Float(required=False)
1239+
1240+
amount = fields.Float(required=False)
1241+
1242+
mop_amount = fields.Float(required=False)
1243+
1244+
earn_points = fields.Float(required=False)
1245+
1246+
earn_points_amount = fields.Float(required=False)
1247+
1248+
earn_title = fields.Str(required=False)
1249+
1250+
title = fields.Str(required=False)
1251+
12321252

12331253

12341254
class CartBreakup(BaseSchema):
@@ -1739,11 +1759,11 @@ class BulkPriceResult(BaseSchema):
17391759

17401760

17411761

1742-
class RewardPointCreation(BaseSchema):
1762+
class RedeemLoyaltyPoints(BaseSchema):
17431763
# Cart swagger.json
17441764

17451765

1746-
points = fields.Boolean(required=False)
1766+
redeem_points = fields.Boolean(required=False)
17471767

17481768

17491769

fdk_client/application/cart/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class getBulkDiscountOffers(BaseSchema):
378378

379379

380380

381-
class applyRewardPoints(BaseSchema):
381+
class applyLoyaltyPoints(BaseSchema):
382382

383383

384384
x__ordering__source = fields.Nested(OrderingSource, required=False)

fdk_client/application/catalog/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ class ProductDetailGroupedAttribute(BaseSchema):
727727

728728
title = fields.Str(required=False)
729729

730+
id = fields.Str(required=False)
731+
730732
details = fields.List(fields.Nested(ProductDetailAttribute, required=False), required=False)
731733

732734

fdk_client/application/theme/client.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ async def getAllPages(self, theme_id=None, body="", request_headers:Dict={}):
7474

7575
return response
7676

77-
async def getPage(self, theme_id=None, page_value=None, filters=None, section_preview_hash=None, company=None, body="", request_headers:Dict={}):
78-
"""Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api.
77+
async def getPage(self, theme_id=None, page_value=None, filters=None, section_preview_hash=None, company=None, url_params=None, body="", request_headers:Dict={}):
78+
"""Get page level configurations, applied sections and seo data of a page by `page_value` received from list pages api. Supports dynamic URL parameter for custom sections.
7979
:param theme_id : Id of the theme to be retrieved. : type string
8080
:param page_value : Value of the page to be retrieved. : type string
8181
:param filters : Filters on sections to be applied or not. : type string
8282
:param section_preview_hash : Unique hash id on sections preview. : type string
8383
:param company : Company id of the application. : type integer
84+
:param url_params : URL parameters extracted from the browser path and query string, used for dynamic variable mapping in custom sections. The value should be a stringified JSON object containing the browser's URL parameters, with the JSON escaped. : type string
8485
"""
8586
payload = {}
8687

@@ -94,14 +95,16 @@ async def getPage(self, theme_id=None, page_value=None, filters=None, section_pr
9495
payload["section_preview_hash"] = section_preview_hash
9596
if company is not None:
9697
payload["company"] = company
98+
if url_params is not None:
99+
payload["url_params"] = url_params
97100

98101
# Parameter validation
99102
schema = ThemeValidator.getPage()
100103
schema.dump(schema.load(payload))
101104

102105

103-
url_with_params = await create_url_with_params(api_url=self._urls["getPage"], proccessed_params="""{"required":[{"name":"theme_id","in":"path","description":"Id of the theme to be retrieved.","required":true,"schema":{"type":"string"}},{"name":"page_value","in":"path","description":"Value of the page to be retrieved.","required":true,"schema":{"type":"string"}}],"optional":[{"name":"filters","in":"query","description":"Filters on sections to be applied or not.","required":false,"schema":{"type":"string"}},{"name":"section_preview_hash","in":"query","description":"Unique hash id on sections preview.","required":false,"schema":{"type":"string"}},{"name":"company","in":"query","description":"Company id of the application.","required":false,"schema":{"type":"integer"}}],"query":[{"name":"filters","in":"query","description":"Filters on sections to be applied or not.","required":false,"schema":{"type":"string"}},{"name":"section_preview_hash","in":"query","description":"Unique hash id on sections preview.","required":false,"schema":{"type":"string"}},{"name":"company","in":"query","description":"Company id of the application.","required":false,"schema":{"type":"integer"}}],"headers":[],"path":[{"name":"theme_id","in":"path","description":"Id of the theme to be retrieved.","required":true,"schema":{"type":"string"}},{"name":"page_value","in":"path","description":"Value of the page to be retrieved.","required":true,"schema":{"type":"string"}}]}""", serverType="application", theme_id=theme_id, page_value=page_value, filters=filters, section_preview_hash=section_preview_hash, company=company)
104-
query_string = await create_query_string(filters=filters, section_preview_hash=section_preview_hash, company=company)
106+
url_with_params = await create_url_with_params(api_url=self._urls["getPage"], proccessed_params="""{"required":[{"name":"theme_id","in":"path","description":"Id of the theme to be retrieved.","required":true,"schema":{"type":"string"}},{"name":"page_value","in":"path","description":"Value of the page to be retrieved.","required":true,"schema":{"type":"string"}}],"optional":[{"name":"filters","in":"query","description":"Filters on sections to be applied or not.","required":false,"schema":{"type":"string"}},{"name":"section_preview_hash","in":"query","description":"Unique hash id on sections preview.","required":false,"schema":{"type":"string"}},{"name":"company","in":"query","description":"Company id of the application.","required":false,"schema":{"type":"integer"}},{"name":"url_params","in":"query","description":"URL parameters extracted from the browser path and query string, used for dynamic variable mapping in custom sections. The value should be a stringified JSON object containing the browser's URL parameters, with the JSON escaped.","required":false,"schema":{"type":"string","format":"json"},"example":"{\"slug\": \"awesome-product\", \"page_type\": \"product\", \"path_segment_0\": \"product\", \"path_segment_1\": \"awesome-product\", \"full_path\": \"/product/awesome-product\"}"}],"query":[{"name":"filters","in":"query","description":"Filters on sections to be applied or not.","required":false,"schema":{"type":"string"}},{"name":"section_preview_hash","in":"query","description":"Unique hash id on sections preview.","required":false,"schema":{"type":"string"}},{"name":"company","in":"query","description":"Company id of the application.","required":false,"schema":{"type":"integer"}},{"name":"url_params","in":"query","description":"URL parameters extracted from the browser path and query string, used for dynamic variable mapping in custom sections. The value should be a stringified JSON object containing the browser's URL parameters, with the JSON escaped.","required":false,"schema":{"type":"string","format":"json"},"example":"{\"slug\": \"awesome-product\", \"page_type\": \"product\", \"path_segment_0\": \"product\", \"path_segment_1\": \"awesome-product\", \"full_path\": \"/product/awesome-product\"}"}],"headers":[],"path":[{"name":"theme_id","in":"path","description":"Id of the theme to be retrieved.","required":true,"schema":{"type":"string"}},{"name":"page_value","in":"path","description":"Value of the page to be retrieved.","required":true,"schema":{"type":"string"}}]}""", serverType="application", theme_id=theme_id, page_value=page_value, filters=filters, section_preview_hash=section_preview_hash, company=company, url_params=url_params)
107+
query_string = await create_query_string(filters=filters, section_preview_hash=section_preview_hash, company=company, url_params=url_params)
105108
if query_string:
106109
url_with_params += "?" + query_string
107110

@@ -119,7 +122,7 @@ async def getPage(self, theme_id=None, page_value=None, filters=None, section_pr
119122
if not key.startswith("x-fp-"):
120123
exclude_headers.append(key)
121124

122-
response = await AiohttpHelper().aiohttp_request("GET", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["getPage"]).netloc, "get", await create_url_without_domain("/service/application/theme/v1.0/{theme_id}/{page_value}", theme_id=theme_id, page_value=page_value, filters=filters, section_preview_hash=section_preview_hash, company=company), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
125+
response = await AiohttpHelper().aiohttp_request("GET", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["getPage"]).netloc, "get", await create_url_without_domain("/service/application/theme/v1.0/{theme_id}/{page_value}", theme_id=theme_id, page_value=page_value, filters=filters, section_preview_hash=section_preview_hash, company=company, url_params=url_params), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
123126

124127
if 200 <= int(response['status_code']) < 300:
125128
from .models import AvailablePageSchema

fdk_client/application/theme/validator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121

22+
2223

2324

2425

@@ -49,6 +50,8 @@ class getPage(BaseSchema):
4950
section_preview_hash = fields.Str(required=False)
5051

5152
company = fields.Int(required=False)
53+
54+
url_params = fields.Str(required=False)
5255

5356

5457

0 commit comments

Comments
 (0)