Skip to content

Commit b4b727a

Browse files
committed
[Auto Generated] 3.16.0
1 parent ff504da commit b4b727a

File tree

24 files changed

+1077
-608
lines changed

24 files changed

+1077
-608
lines changed

CHANGELOG.md

Lines changed: 499 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.15.0#egg=fdk_client"
17+
pip install "git+https://github.com/gofynd/fdk-client-python.git@3.16.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.15.0"
1+
__version__ = "3.16.0"

fdk_client/application/configuration/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,10 @@ class OrderFeature(BaseSchema):
10851085

10861086
buy_again = fields.Boolean(required=False)
10871087

1088+
enabled = fields.Boolean(required=False)
1089+
1090+
message = fields.Str(required=False)
1091+
10881092

10891093

10901094
class DeliveryStrategy(BaseSchema):

fdk_client/application/content/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ async def getSEOMarkupSchemas(self, page_type=None, active=None, body="", reques
660660
schema.dump(schema.load(payload))
661661

662662

663-
url_with_params = await create_url_with_params(api_url=self._urls["getSEOMarkupSchemas"], proccessed_params="""{"required":[],"optional":[{"name":"page_type","in":"query","description":"The type of page against which schema template was created.","required":false,"schema":{"type":"string","enum":["about-us","addresses","blog","brands","cards","cart","categories","brand","category","collection","collections","contact-us","external","faq","freshchat","home","notification-settings","orders","page","policy","product","product-request","products","profile","profile-order-shipment","profile-basic","profile-company","profile-emails","profile-phones","rate-us","refer-earn","settings","shared-cart","tnc","track-order","wishlist","sections","form","cart-delivery","cart-payment","cart-review","login","register","shipping-policy","return-policy","order-status"]}},{"name":"active","in":"query","description":"Boolean value for fetching seo schema.","required":false,"schema":{"type":"boolean","default":true}}],"query":[{"name":"page_type","in":"query","description":"The type of page against which schema template was created.","required":false,"schema":{"type":"string","enum":["about-us","addresses","blog","brands","cards","cart","categories","brand","category","collection","collections","contact-us","external","faq","freshchat","home","notification-settings","orders","page","policy","product","product-request","products","profile","profile-order-shipment","profile-basic","profile-company","profile-emails","profile-phones","rate-us","refer-earn","settings","shared-cart","tnc","track-order","wishlist","sections","form","cart-delivery","cart-payment","cart-review","login","register","shipping-policy","return-policy","order-status"]}},{"name":"active","in":"query","description":"Boolean value for fetching seo schema.","required":false,"schema":{"type":"boolean","default":true}}],"headers":[],"path":[]}""", serverType="application", page_type=page_type, active=active)
663+
url_with_params = await create_url_with_params(api_url=self._urls["getSEOMarkupSchemas"], proccessed_params="""{"required":[],"optional":[{"name":"page_type","in":"query","description":"The type of page against which schema template was created.","required":false,"schema":{"type":"string","enum":["about-us","addresses","blog","brands","cards","cart","categories","brand","category","collection","collections","contact-us","external","faq","freshchat","home","notification-settings","orders","page","policy","product","product-request","products","profile","profile-order-shipment","profile-basic","profile-company","profile-email","profile-phone","rate-us","refer-earn","settings","shared-cart","tnc","track-order","wishlist","sections","form","cart-delivery","cart-payment","cart-review","login","register","shipping-policy","return-policy","order-status"]}},{"name":"active","in":"query","description":"Boolean value for fetching seo schema.","required":false,"schema":{"type":"boolean","default":true}}],"query":[{"name":"page_type","in":"query","description":"The type of page against which schema template was created.","required":false,"schema":{"type":"string","enum":["about-us","addresses","blog","brands","cards","cart","categories","brand","category","collection","collections","contact-us","external","faq","freshchat","home","notification-settings","orders","page","policy","product","product-request","products","profile","profile-order-shipment","profile-basic","profile-company","profile-email","profile-phone","rate-us","refer-earn","settings","shared-cart","tnc","track-order","wishlist","sections","form","cart-delivery","cart-payment","cart-review","login","register","shipping-policy","return-policy","order-status"]}},{"name":"active","in":"query","description":"Boolean value for fetching seo schema.","required":false,"schema":{"type":"boolean","default":true}}],"headers":[],"path":[]}""", serverType="application", page_type=page_type, active=active)
664664
query_string = await create_query_string(page_type=page_type, active=active)
665665
if query_string:
666666
url_with_params += "?" + query_string

fdk_client/application/order/client.py

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def __init__(self, config: ApplicationConfig):
2626
"verifyOtpShipmentCustomer": "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
2727
"getShipmentBagReasons": "/service/application/order/v1.0/orders/shipments/{shipment_id}/bags/{bag_id}/reasons",
2828
"getShipmentReasons": "/service/application/order/v1.0/orders/shipments/{shipment_id}/reasons",
29-
"updateShipmentStatus": "/service/application/order/v1.0/orders/shipments/{shipment_id}/status"
29+
"updateShipmentStatus": "/service/application/order/v1.0/orders/shipments/{shipment_id}/status",
30+
"submitDeliveryReattemptRequest": "/service/application/order/v1.0/shipments/{shipment_id}/delivery-reattempt"
3031

3132
}
3233
self._urls = {
@@ -391,25 +392,31 @@ async def getCustomerDetailsByShipmentId(self, order_id=None, shipment_id=None,
391392

392393
return response
393394

394-
async def sendOtpToShipmentCustomer(self, order_id=None, shipment_id=None, body="", request_headers:Dict={}):
395+
async def sendOtpToShipmentCustomer(self, order_id=None, shipment_id=None, event_type=None, body="", request_headers:Dict={}):
395396
"""Send OTP to the customer for shipment verification.
396397
:param order_id : A unique number used for identifying and tracking your orders. : type string
397398
:param shipment_id : ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID. : type string
399+
:param event_type : Type of the event for which the OTP needs to be sent. This determines the context or purpose of OTP verification. Supported values are:
400+
- `refund_bank_details`: Used when the customer needs to verify refund bank information.
401+
- `customer_ndr`: Used when the customer needs to confirm delivery preferences after a failed delivery attempt (Non-Delivery Report).
402+
: type string
398403
"""
399404
payload = {}
400405

401406
if order_id is not None:
402407
payload["order_id"] = order_id
403408
if shipment_id is not None:
404409
payload["shipment_id"] = shipment_id
410+
if event_type is not None:
411+
payload["event_type"] = event_type
405412

406413
# Parameter validation
407414
schema = OrderValidator.sendOtpToShipmentCustomer()
408415
schema.dump(schema.load(payload))
409416

410417

411-
url_with_params = await create_url_with_params(api_url=self._urls["sendOtpToShipmentCustomer"], proccessed_params="""{"required":[{"in":"path","name":"order_id","description":"A unique number used for identifying and tracking your orders.","required":true,"schema":{"type":"string","default":"FY6299E19701B4EAEFC2"}},{"in":"path","name":"shipment_id","description":"ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID.","required":true,"schema":{"type":"string","default":"16544950215681060915J"}}],"optional":[],"query":[],"headers":[],"path":[{"in":"path","name":"order_id","description":"A unique number used for identifying and tracking your orders.","required":true,"schema":{"type":"string","default":"FY6299E19701B4EAEFC2"}},{"in":"path","name":"shipment_id","description":"ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID.","required":true,"schema":{"type":"string","default":"16544950215681060915J"}}]}""", serverType="application", order_id=order_id, shipment_id=shipment_id)
412-
query_string = await create_query_string()
418+
url_with_params = await create_url_with_params(api_url=self._urls["sendOtpToShipmentCustomer"], proccessed_params="""{"required":[{"in":"path","name":"order_id","description":"A unique number used for identifying and tracking your orders.","required":true,"schema":{"type":"string","default":"FY6299E19701B4EAEFC2"}},{"in":"path","name":"shipment_id","description":"ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID.","required":true,"schema":{"type":"string","default":"16544950215681060915J"}}],"optional":[{"in":"query","name":"event_type","description":"Type of the event for which the OTP needs to be sent. This determines the context or purpose of OTP verification. Supported values are:\n - `refund_bank_details`: Used when the customer needs to verify refund bank information.\n - `customer_ndr`: Used when the customer needs to confirm delivery preferences after a failed delivery attempt (Non-Delivery Report).\n","required":false,"schema":{"type":"string","enum":["refund_bank_details","customer_ndr"],"default":"refund_bank_details"}}],"query":[{"in":"query","name":"event_type","description":"Type of the event for which the OTP needs to be sent. This determines the context or purpose of OTP verification. Supported values are:\n - `refund_bank_details`: Used when the customer needs to verify refund bank information.\n - `customer_ndr`: Used when the customer needs to confirm delivery preferences after a failed delivery attempt (Non-Delivery Report).\n","required":false,"schema":{"type":"string","enum":["refund_bank_details","customer_ndr"],"default":"refund_bank_details"}}],"headers":[],"path":[{"in":"path","name":"order_id","description":"A unique number used for identifying and tracking your orders.","required":true,"schema":{"type":"string","default":"FY6299E19701B4EAEFC2"}},{"in":"path","name":"shipment_id","description":"ID of the shipment. An order may contain multiple items and may get divided into one or more shipment, each having its own ID.","required":true,"schema":{"type":"string","default":"16544950215681060915J"}}]}""", serverType="application", order_id=order_id, shipment_id=shipment_id, event_type=event_type)
419+
query_string = await create_query_string(event_type=event_type)
413420
if query_string:
414421
url_with_params += "?" + query_string
415422

@@ -427,7 +434,7 @@ async def sendOtpToShipmentCustomer(self, order_id=None, shipment_id=None, body=
427434
if not key.startswith("x-fp-"):
428435
exclude_headers.append(key)
429436

430-
response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["sendOtpToShipmentCustomer"]).netloc, "post", await create_url_without_domain("/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/", order_id=order_id, shipment_id=shipment_id), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
437+
response = await AiohttpHelper().aiohttp_request("POST", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["sendOtpToShipmentCustomer"]).netloc, "post", await create_url_without_domain("/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/", order_id=order_id, shipment_id=shipment_id, event_type=event_type), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
431438

432439
if 200 <= int(response['status_code']) < 300:
433440
from .models import SendOtpToCustomerResponseSchema
@@ -637,4 +644,54 @@ async def updateShipmentStatus(self, shipment_id=None, body="", request_headers:
637644
print(e)
638645

639646
return response
647+
648+
async def submitDeliveryReattemptRequest(self, shipment_id=None, body="", request_headers:Dict={}):
649+
"""This operation allows customers to submit a request for reattempting the delivery of a specific shipment with optional address updates and a new delivery date.
650+
:param shipment_id : The unique identifier for the shipment. : type string
651+
"""
652+
payload = {}
653+
654+
if shipment_id is not None:
655+
payload["shipment_id"] = shipment_id
656+
657+
# Parameter validation
658+
schema = OrderValidator.submitDeliveryReattemptRequest()
659+
schema.dump(schema.load(payload))
660+
661+
# Body validation
662+
from .models import DeliveryReattemptRequestSchema
663+
schema = DeliveryReattemptRequestSchema()
664+
schema.dump(schema.load(body))
665+
666+
url_with_params = await create_url_with_params(api_url=self._urls["submitDeliveryReattemptRequest"], proccessed_params="""{"required":[{"in":"path","description":"The unique identifier for the shipment.","name":"shipment_id","required":true,"schema":{"type":"string"}}],"optional":[],"query":[],"headers":[],"path":[{"in":"path","description":"The unique identifier for the shipment.","name":"shipment_id","required":true,"schema":{"type":"string"}}]}""", serverType="application", shipment_id=shipment_id)
667+
query_string = await create_query_string()
668+
if query_string:
669+
url_with_params += "?" + query_string
670+
671+
headers={}
672+
headers["Authorization"] = f'Bearer {base64.b64encode(f"{self._conf.applicationID}:{self._conf.applicationToken}".encode()).decode()}'
673+
if self._conf.locationDetails:
674+
headers["x-location-detail"] = ujson.dumps(self._conf.locationDetails)
675+
for h in self._conf.extraHeaders:
676+
headers.update(h)
677+
if request_headers != {}:
678+
headers.update(request_headers)
679+
680+
exclude_headers = []
681+
for key, val in headers.items():
682+
if not key.startswith("x-fp-"):
683+
exclude_headers.append(key)
684+
685+
response = await AiohttpHelper().aiohttp_request("PUT", url_with_params, headers=get_headers_with_signature(urlparse(self._urls["submitDeliveryReattemptRequest"]).netloc, "put", await create_url_without_domain("/service/application/order/v1.0/shipments/{shipment_id}/delivery-reattempt", shipment_id=shipment_id), query_string, headers, body, exclude_headers=exclude_headers), data=body, cookies=self._conf.cookies, debug=(self._conf.logLevel=="DEBUG"))
686+
687+
if 200 <= int(response['status_code']) < 300:
688+
from .models import DeliveryReattemptSuccessResponseSchema
689+
schema = DeliveryReattemptSuccessResponseSchema()
690+
try:
691+
schema.load(response["json"])
692+
except Exception as e:
693+
print("Response Validation failed for submitDeliveryReattemptRequest")
694+
print(e)
695+
696+
return response
640697

0 commit comments

Comments
 (0)