Skip to content

Commit f7630ce

Browse files
authored
Merge pull request #8 from friendscottn/main
Adding support for nextCursor
2 parents 1a8fd5a + 042709b commit f7630ce

7 files changed

Lines changed: 226 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ composer.lock
1717

1818
# IDE
1919
.vscode
20+
.idea/
2021

2122
# OS X
2223
**/.DS_Store

docs/Apis/MP/US/OrdersApi.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ See the [Authorization](../../../../README.md#authorization) section of the READ
137137
## `getAllOrders()`
138138

139139
```php
140-
getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3
140+
getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3
141141
```
142142
All orders
143143

@@ -177,9 +177,14 @@ $shipNodeType = 'SellerFulfilled'; // string | Specifies the type of shipNode. A
177177
$shippingProgramType = 'shippingProgramType_example'; // string | Specifies the type of program. Allowed value is TWO_DAY.
178178
$replacementInfo = 'false'; // string | Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false.
179179
$orderType = 'orderType_example'; // string | Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true.
180+
$hasMoreElements = 'hasMoreElements_example'; // string | hasMoreElements
181+
$soIndex = 'soIndex_example'; // string | Sales order index. This should only be populated from a next token
182+
$poIndex = 'poIndex_example'; // string | Purchase order index. This should only be populated from a next token
183+
$partnerId = 'partnerId_example'; // string | partnerId
184+
$sellerId = 'sellerId_example'; // string | sellerId
180185

181186
try {
182-
$result = $api->getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
187+
$result = $api->getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
183188
print_r($result);
184189
} catch (Exception $e) {
185190
echo "Exception when calling OrdersApi->getAllOrders: {$e->getMessage()}\n";
@@ -205,6 +210,11 @@ try {
205210
| **shippingProgramType** | **string**| Specifies the type of program. Allowed value is TWO_DAY. | [optional] |
206211
| **replacementInfo** | **string**| Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. | [optional] [default to 'false'] |
207212
| **orderType** | **string**| Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. | [optional] |
213+
| **hasMoreElements** | **string**| hasMoreElements | [optional] |
214+
| **soIndex** | **string**| Sales order index. This should only be populated from a next token | [optional] |
215+
| **poIndex** | **string**| Purchase order index. This should only be populated from a next token | [optional] |
216+
| **partnerId** | **string**| partnerId | [optional] |
217+
| **sellerId** | **string**| sellerId | [optional] |
208218

209219

210220
### Return type

resources/schema-additions.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"us": {
3+
"mp": {
4+
"orders": {
5+
"paths": {
6+
"\/v3\/orders": {
7+
"get": {
8+
"parameters": [
9+
{
10+
"name": "hasMoreElements",
11+
"in": "query",
12+
"description": "hasMoreElements",
13+
"required": false,
14+
"schema": {
15+
"type": "string"
16+
}
17+
},
18+
{
19+
"name": "soIndex",
20+
"in": "query",
21+
"description": "Sales order index. This should only be populated from a next token",
22+
"required": false,
23+
"schema": {
24+
"type": "string"
25+
}
26+
},
27+
{
28+
"name": "poIndex",
29+
"in": "query",
30+
"description": "Purchase order index. This should only be populated from a next token",
31+
"required": false,
32+
"schema": {
33+
"type": "string"
34+
}
35+
},
36+
{
37+
"name": "partnerId",
38+
"in": "query",
39+
"description": "partnerId",
40+
"required": false,
41+
"schema": {
42+
"type": "string"
43+
}
44+
},
45+
{
46+
"name": "sellerId",
47+
"in": "query",
48+
"description": "sellerId",
49+
"required": false,
50+
"schema": {
51+
"type": "string"
52+
}
53+
}
54+
]
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
}

resources/schemas/us/mp/orders.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,51 @@
875875
"schema": {
876876
"type": "string"
877877
}
878+
},
879+
{
880+
"name": "hasMoreElements",
881+
"in": "query",
882+
"description": "hasMoreElements",
883+
"required": false,
884+
"schema": {
885+
"type": "string"
886+
}
887+
},
888+
{
889+
"name": "soIndex",
890+
"in": "query",
891+
"description": "Sales order index. This should only be populated from a next token",
892+
"required": false,
893+
"schema": {
894+
"type": "string"
895+
}
896+
},
897+
{
898+
"name": "poIndex",
899+
"in": "query",
900+
"description": "Purchase order index. This should only be populated from a next token",
901+
"required": false,
902+
"schema": {
903+
"type": "string"
904+
}
905+
},
906+
{
907+
"name": "partnerId",
908+
"in": "query",
909+
"description": "partnerId",
910+
"required": false,
911+
"schema": {
912+
"type": "string"
913+
}
914+
},
915+
{
916+
"name": "sellerId",
917+
"in": "query",
918+
"description": "sellerId",
919+
"required": false,
920+
"schema": {
921+
"type": "string"
922+
}
878923
}
879924
],
880925
"responses": {

src/Apis/MP/US/OrdersApi.php

Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,11 @@ protected function cancelOrderLinesRequest(
674674
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
675675
* @param string $replacementInfo Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. (optional, default to 'false')
676676
* @param string $orderType Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. (optional)
677+
* @param string $hasMoreElements hasMoreElements (optional)
678+
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
679+
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
680+
* @param string $partnerId partnerId (optional)
681+
* @param string $sellerId sellerId (optional)
677682
*
678683
* @throws \Walmart\ApiException on non-2xx response
679684
* @throws \InvalidArgumentException
@@ -695,9 +700,14 @@ public function getAllOrders(
695700
?string $shipNodeType = 'SellerFulfilled',
696701
?string $shippingProgramType = null,
697702
?string $replacementInfo = 'false',
698-
?string $orderType = null
703+
?string $orderType = null,
704+
?string $hasMoreElements = null,
705+
?string $soIndex = null,
706+
?string $poIndex = null,
707+
?string $partnerId = null,
708+
?string $sellerId = null
699709
): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3 {
700-
return $this->getAllOrdersWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
710+
return $this->getAllOrdersWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
701711
}
702712

703713
/**
@@ -721,6 +731,11 @@ public function getAllOrders(
721731
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
722732
* @param string $replacementInfo Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. (optional, default to 'false')
723733
* @param string $orderType Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. (optional)
734+
* @param string $hasMoreElements hasMoreElements (optional)
735+
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
736+
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
737+
* @param string $partnerId partnerId (optional)
738+
* @param string $sellerId sellerId (optional)
724739
*
725740
* @throws \Walmart\ApiException on non-2xx response
726741
* @throws \InvalidArgumentException
@@ -743,8 +758,13 @@ protected function getAllOrdersWithHttpInfo(
743758
?string $shippingProgramType = null,
744759
?string $replacementInfo = 'false',
745760
?string $orderType = null,
761+
?string $hasMoreElements = null,
762+
?string $soIndex = null,
763+
?string $poIndex = null,
764+
?string $partnerId = null,
765+
?string $sellerId = null,
746766
): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3 {
747-
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
767+
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
748768
$this->writeDebug($request);
749769
$this->writeDebug((string) $request->getBody());
750770

@@ -854,6 +874,11 @@ protected function getAllOrdersWithHttpInfo(
854874
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
855875
* @param string $replacementInfo Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. (optional, default to 'false')
856876
* @param string $orderType Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. (optional)
877+
* @param string $hasMoreElements hasMoreElements (optional)
878+
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
879+
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
880+
* @param string $partnerId partnerId (optional)
881+
* @param string $sellerId sellerId (optional)
857882
*
858883
* @throws \InvalidArgumentException
859884
* @return \GuzzleHttp\Promise\PromiseInterface
@@ -874,9 +899,14 @@ public function getAllOrdersAsync(
874899
?string $shipNodeType = 'SellerFulfilled',
875900
?string $shippingProgramType = null,
876901
?string $replacementInfo = 'false',
877-
?string $orderType = null
902+
?string $orderType = null,
903+
?string $hasMoreElements = null,
904+
?string $soIndex = null,
905+
?string $poIndex = null,
906+
?string $partnerId = null,
907+
?string $sellerId = null
878908
): PromiseInterface {
879-
return $this->getAllOrdersAsyncWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType)
909+
return $this->getAllOrdersAsyncWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId)
880910
->then(
881911
function ($response) {
882912
return $response[0];
@@ -905,6 +935,11 @@ function ($response) {
905935
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
906936
* @param string $replacementInfo Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. (optional, default to 'false')
907937
* @param string $orderType Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. (optional)
938+
* @param string $hasMoreElements hasMoreElements (optional)
939+
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
940+
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
941+
* @param string $partnerId partnerId (optional)
942+
* @param string $sellerId sellerId (optional)
908943
*
909944
* @throws \InvalidArgumentException
910945
* @return \GuzzleHttp\Promise\PromiseInterface
@@ -926,9 +961,14 @@ protected function getAllOrdersAsyncWithHttpInfo(
926961
?string $shippingProgramType = null,
927962
?string $replacementInfo = 'false',
928963
?string $orderType = null,
964+
?string $hasMoreElements = null,
965+
?string $soIndex = null,
966+
?string $poIndex = null,
967+
?string $partnerId = null,
968+
?string $sellerId = null,
929969
): PromiseInterface {
930970
$returnType = '\Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3';
931-
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
971+
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
932972
$this->writeDebug($request);
933973
$this->writeDebug((string) $request->getBody());
934974

@@ -989,6 +1029,11 @@ function ($exception) {
9891029
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
9901030
* @param string $replacementInfo Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. (optional, default to 'false')
9911031
* @param string $orderType Specifies if the order is a regular order or replacement order. Possible values are REGULAR or REPLACEMENT. Provided in response only if query parameter replacementInfo=true. (optional)
1032+
* @param string $hasMoreElements hasMoreElements (optional)
1033+
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
1034+
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
1035+
* @param string $partnerId partnerId (optional)
1036+
* @param string $sellerId sellerId (optional)
9921037
*
9931038
* @throws \InvalidArgumentException
9941039
* @return \GuzzleHttp\Psr7\Request
@@ -1010,6 +1055,11 @@ protected function getAllOrdersRequest(
10101055
?string $shippingProgramType = null,
10111056
?string $replacementInfo = 'false',
10121057
?string $orderType = null,
1058+
?string $hasMoreElements = null,
1059+
?string $soIndex = null,
1060+
?string $poIndex = null,
1061+
?string $partnerId = null,
1062+
?string $sellerId = null,
10131063
): Request {
10141064
$contentType = self::contentTypes['getAllOrders'];
10151065

@@ -1151,6 +1201,46 @@ protected function getAllOrdersRequest(
11511201
true, // explode
11521202
false // required
11531203
) ?? [],
1204+
ObjectSerializer::toQueryValue(
1205+
$hasMoreElements,
1206+
'hasMoreElements', // param base name
1207+
'string', // openApiType
1208+
'form', // style
1209+
true, // explode
1210+
false // required
1211+
) ?? [],
1212+
ObjectSerializer::toQueryValue(
1213+
$soIndex,
1214+
'soIndex', // param base name
1215+
'string', // openApiType
1216+
'form', // style
1217+
true, // explode
1218+
false // required
1219+
) ?? [],
1220+
ObjectSerializer::toQueryValue(
1221+
$poIndex,
1222+
'poIndex', // param base name
1223+
'string', // openApiType
1224+
'form', // style
1225+
true, // explode
1226+
false // required
1227+
) ?? [],
1228+
ObjectSerializer::toQueryValue(
1229+
$partnerId,
1230+
'partnerId', // param base name
1231+
'string', // openApiType
1232+
'form', // style
1233+
true, // explode
1234+
false // required
1235+
) ?? [],
1236+
ObjectSerializer::toQueryValue(
1237+
$sellerId,
1238+
'sellerId', // param base name
1239+
'string', // openApiType
1240+
'form', // style
1241+
true, // explode
1242+
false // required
1243+
) ?? [],
11541244
);
11551245

11561246
$headers = $this->headerSelector->selectHeaders(

0 commit comments

Comments
 (0)