Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for nextCursor #8

Merged
merged 6 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ composer.lock

# IDE
.vscode
.idea/

# OS X
**/.DS_Store
14 changes: 12 additions & 2 deletions docs/Apis/MP/US/OrdersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ See the [Authorization](../../../../README.md#authorization) section of the READ
## `getAllOrders()`

```php
getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3
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
```
All orders

Expand Down Expand Up @@ -177,9 +177,14 @@ $shipNodeType = 'SellerFulfilled'; // string | Specifies the type of shipNode. A
$shippingProgramType = 'shippingProgramType_example'; // string | Specifies the type of program. Allowed value is TWO_DAY.
$replacementInfo = 'false'; // string | Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false.
$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.
$hasMoreElements = 'hasMoreElements_example'; // string | hasMoreElements
$soIndex = 'soIndex_example'; // string | Sales order index. This should only be populated from a next token
$poIndex = 'poIndex_example'; // string | Purchase order index. This should only be populated from a next token
$partnerId = 'partnerId_example'; // string | partnerId
$sellerId = 'sellerId_example'; // string | sellerId

try {
$result = $api->getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
$result = $api->getAllOrders($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling OrdersApi->getAllOrders: {$e->getMessage()}\n";
Expand All @@ -205,6 +210,11 @@ try {
| **shippingProgramType** | **string**| Specifies the type of program. Allowed value is TWO_DAY. | [optional] |
| **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'] |
| **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] |
| **hasMoreElements** | **string**| hasMoreElements | [optional] |
| **soIndex** | **string**| Sales order index. This should only be populated from a next token | [optional] |
| **poIndex** | **string**| Purchase order index. This should only be populated from a next token | [optional] |
| **partnerId** | **string**| partnerId | [optional] |
| **sellerId** | **string**| sellerId | [optional] |


### Return type
Expand Down
61 changes: 61 additions & 0 deletions resources/schema-additions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"us": {
"mp": {
"orders": {
"paths": {
"\/v3\/orders": {
"get": {
"parameters": [
{
"name": "hasMoreElements",
"in": "query",
"description": "hasMoreElements",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "soIndex",
"in": "query",
"description": "Sales order index. This should only be populated from a next token",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "poIndex",
"in": "query",
"description": "Purchase order index. This should only be populated from a next token",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "partnerId",
"in": "query",
"description": "partnerId",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "sellerId",
"in": "query",
"description": "sellerId",
"required": false,
"schema": {
"type": "string"
}
}
]
}
}
}
}
}
}
}
45 changes: 45 additions & 0 deletions resources/schemas/us/mp/orders.json
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,51 @@
"schema": {
"type": "string"
}
},
{
"name": "hasMoreElements",
"in": "query",
"description": "hasMoreElements",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "soIndex",
"in": "query",
"description": "Sales order index. This should only be populated from a next token",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "poIndex",
"in": "query",
"description": "Purchase order index. This should only be populated from a next token",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "partnerId",
"in": "query",
"description": "partnerId",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "sellerId",
"in": "query",
"description": "sellerId",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
Expand Down
102 changes: 96 additions & 6 deletions src/Apis/MP/US/OrdersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,11 @@ protected function cancelOrderLinesRequest(
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
* @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')
* @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)
* @param string $hasMoreElements hasMoreElements (optional)
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
* @param string $partnerId partnerId (optional)
* @param string $sellerId sellerId (optional)
*
* @throws \Walmart\ApiException on non-2xx response
* @throws \InvalidArgumentException
Expand All @@ -695,9 +700,14 @@ public function getAllOrders(
?string $shipNodeType = 'SellerFulfilled',
?string $shippingProgramType = null,
?string $replacementInfo = 'false',
?string $orderType = null
?string $orderType = null,
?string $hasMoreElements = null,
?string $soIndex = null,
?string $poIndex = null,
?string $partnerId = null,
?string $sellerId = null
): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3 {
return $this->getAllOrdersWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
return $this->getAllOrdersWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
}

/**
Expand All @@ -721,6 +731,11 @@ public function getAllOrders(
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
* @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')
* @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)
* @param string $hasMoreElements hasMoreElements (optional)
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
* @param string $partnerId partnerId (optional)
* @param string $sellerId sellerId (optional)
*
* @throws \Walmart\ApiException on non-2xx response
* @throws \InvalidArgumentException
Expand All @@ -743,8 +758,13 @@ protected function getAllOrdersWithHttpInfo(
?string $shippingProgramType = null,
?string $replacementInfo = 'false',
?string $orderType = null,
?string $hasMoreElements = null,
?string $soIndex = null,
?string $poIndex = null,
?string $partnerId = null,
?string $sellerId = null,
): \Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3 {
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
$this->writeDebug($request);
$this->writeDebug((string) $request->getBody());

Expand Down Expand Up @@ -854,6 +874,11 @@ protected function getAllOrdersWithHttpInfo(
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
* @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')
* @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)
* @param string $hasMoreElements hasMoreElements (optional)
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
* @param string $partnerId partnerId (optional)
* @param string $sellerId sellerId (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
Expand All @@ -874,9 +899,14 @@ public function getAllOrdersAsync(
?string $shipNodeType = 'SellerFulfilled',
?string $shippingProgramType = null,
?string $replacementInfo = 'false',
?string $orderType = null
?string $orderType = null,
?string $hasMoreElements = null,
?string $soIndex = null,
?string $poIndex = null,
?string $partnerId = null,
?string $sellerId = null
): PromiseInterface {
return $this->getAllOrdersAsyncWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType)
return $this->getAllOrdersAsyncWithHttpInfo($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId)
->then(
function ($response) {
return $response[0];
Expand Down Expand Up @@ -905,6 +935,11 @@ function ($response) {
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
* @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')
* @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)
* @param string $hasMoreElements hasMoreElements (optional)
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
* @param string $partnerId partnerId (optional)
* @param string $sellerId sellerId (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
Expand All @@ -926,9 +961,14 @@ protected function getAllOrdersAsyncWithHttpInfo(
?string $shippingProgramType = null,
?string $replacementInfo = 'false',
?string $orderType = null,
?string $hasMoreElements = null,
?string $soIndex = null,
?string $poIndex = null,
?string $partnerId = null,
?string $sellerId = null,
): PromiseInterface {
$returnType = '\Walmart\Models\MP\US\Orders\PurchaseOrderTypeV3';
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType);
$request = $this->getAllOrdersRequest($sku, $customerOrderId, $purchaseOrderId, $status, $createdStartDate, $createdEndDate, $fromExpectedShipDate, $toExpectedShipDate, $lastModifiedStartDate, $lastModifiedEndDate, $limit, $productInfo, $shipNodeType, $shippingProgramType, $replacementInfo, $orderType, $hasMoreElements, $soIndex, $poIndex, $partnerId, $sellerId);
$this->writeDebug($request);
$this->writeDebug((string) $request->getBody());

Expand Down Expand Up @@ -989,6 +1029,11 @@ function ($exception) {
* @param string $shippingProgramType Specifies the type of program. Allowed value is TWO_DAY. (optional)
* @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')
* @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)
* @param string $hasMoreElements hasMoreElements (optional)
* @param string $soIndex Sales order index. This should only be populated from a next token (optional)
* @param string $poIndex Purchase order index. This should only be populated from a next token (optional)
* @param string $partnerId partnerId (optional)
* @param string $sellerId sellerId (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
Expand All @@ -1010,6 +1055,11 @@ protected function getAllOrdersRequest(
?string $shippingProgramType = null,
?string $replacementInfo = 'false',
?string $orderType = null,
?string $hasMoreElements = null,
?string $soIndex = null,
?string $poIndex = null,
?string $partnerId = null,
?string $sellerId = null,
): Request {
$contentType = self::contentTypes['getAllOrders'];

Expand Down Expand Up @@ -1151,6 +1201,46 @@ protected function getAllOrdersRequest(
true, // explode
false // required
) ?? [],
ObjectSerializer::toQueryValue(
$hasMoreElements,
'hasMoreElements', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? [],
ObjectSerializer::toQueryValue(
$soIndex,
'soIndex', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? [],
ObjectSerializer::toQueryValue(
$poIndex,
'poIndex', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? [],
ObjectSerializer::toQueryValue(
$partnerId,
'partnerId', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? [],
ObjectSerializer::toQueryValue(
$sellerId,
'sellerId', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? [],
);

$headers = $this->headerSelector->selectHeaders(
Expand Down
Loading