Skip to content

Commit d7d381b

Browse files
Release 1.0.2
1 parent 5895e99 commit d7d381b

File tree

6 files changed

+61
-42
lines changed

6 files changed

+61
-42
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [1.0.2] - 2025-03-04
4+
5+
### Added
6+
- Get orders by orderIDs
7+
8+
### Changed
9+
10+
### Deprecated
11+
12+
[1.0.2]: https://github.com/grab/grabfood-api-sdk-php/releases/tag/v1.0.2
13+
314
## [1.0.1] - 2025-02-24
415

516
### Added

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,6 @@ vendor/bin/phpunit
257257
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
258258

259259
- API version: `1.1.3`
260-
- Package version: `1.0.1`
260+
- Package version: `1.0.2`
261261
- Generator version: `7.8.0`
262262
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grab/grabfood-api-sdk-php",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
55
"keywords": [
66
"openapitools",

docs/Api/ListOrdersApi.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All URIs are relative to https://partner-api.grab.com/grabfood-sandbox, except i
1010
## `listOrders()`
1111

1212
```php
13-
listOrders($authorization, $merchant_id, $date, $page): \Grab\GrabfoodApiSdk\Model\ListOrdersResponse
13+
listOrders($authorization, $merchant_id, $date, $page, $order_ids): \Grab\GrabfoodApiSdk\Model\ListOrdersResponse
1414
```
1515

1616
List orders
@@ -31,10 +31,11 @@ $apiInstance = new Grab\GrabfoodApiSdk\Api\ListOrdersApi(
3131
$authorization = Bearer <ACCESS_TOKEN_HERE>; // string | Specify the generated authorization token of the bearer type.
3232
$merchant_id = 1-CYNGRUNGSBCCC; // string | The merchant's ID that is in GrabFood's database.
3333
$date = 'date_example'; // string
34-
$page = 1; // int | Specify the page number for the report.
34+
$page = 1; // int | Specify the page number for the report. Required if orderIDs is not provided.
35+
$order_ids = ["123-CYNKLPCVRN5","456-PCVRN5CYNKL"]; // string[] | List of order IDs. If provided, date and page are not required.
3536

3637
try {
37-
$result = $apiInstance->listOrders($authorization, $merchant_id, $date, $page);
38+
$result = $apiInstance->listOrders($authorization, $merchant_id, $date, $page, $order_ids);
3839
print_r($result);
3940
} catch (Exception $e) {
4041
echo 'Exception when calling ListOrdersApi->listOrders: ', $e->getMessage(), PHP_EOL;
@@ -47,8 +48,9 @@ try {
4748
| ------------- | ------------- | ------------- | ------------- |
4849
| **authorization** | **string**| Specify the generated authorization token of the bearer type. | |
4950
| **merchant_id** | **string**| The merchant&#39;s ID that is in GrabFood&#39;s database. | |
50-
| **date** | **string**| | |
51-
| **page** | **int**| Specify the page number for the report. | |
51+
| **date** | **string**| | [optional] |
52+
| **page** | **int**| Specify the page number for the report. Required if orderIDs is not provided. | [optional] |
53+
| **order_ids** | [**string[]**](../Model/string.md)| List of order IDs. If provided, date and page are not required. | [optional] |
5254

5355
### Return type
5456

lib/Api/ListOrdersApi.php

+39-33
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,18 @@ public function getConfig()
132132
*
133133
* @param string $authorization Specify the generated authorization token of the bearer type. (required)
134134
* @param string $merchant_id The merchant&#39;s ID that is in GrabFood&#39;s database. (required)
135-
* @param string $date date (required)
136-
* @param int $page Specify the page number for the report. (required)
135+
* @param string $date date (optional)
136+
* @param int $page Specify the page number for the report. Required if orderIDs is not provided. (optional)
137+
* @param string[] $order_ids List of order IDs. If provided, date and page are not required. (optional)
137138
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrders'] to see the possible values for this operation
138139
*
139140
* @throws \Grab\GrabfoodApiSdk\ApiException on non-2xx response or if the response body is not in the expected format
140141
* @throws \InvalidArgumentException
141142
* @return \Grab\GrabfoodApiSdk\Model\ListOrdersResponse
142143
*/
143-
public function listOrders($authorization, $merchant_id, $date, $page, string $contentType = self::contentTypes['listOrders'][0])
144+
public function listOrders($authorization, $merchant_id, $date = null, $page = null, $order_ids = null, string $contentType = self::contentTypes['listOrders'][0])
144145
{
145-
list($response) = $this->listOrdersWithHttpInfo($authorization, $merchant_id, $date, $page, $contentType);
146+
list($response) = $this->listOrdersWithHttpInfo($authorization, $merchant_id, $date, $page, $order_ids, $contentType);
146147
return $response;
147148
}
148149

@@ -153,17 +154,18 @@ public function listOrders($authorization, $merchant_id, $date, $page, string $c
153154
*
154155
* @param string $authorization Specify the generated authorization token of the bearer type. (required)
155156
* @param string $merchant_id The merchant&#39;s ID that is in GrabFood&#39;s database. (required)
156-
* @param string $date (required)
157-
* @param int $page Specify the page number for the report. (required)
157+
* @param string $date (optional)
158+
* @param int $page Specify the page number for the report. Required if orderIDs is not provided. (optional)
159+
* @param string[] $order_ids List of order IDs. If provided, date and page are not required. (optional)
158160
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrders'] to see the possible values for this operation
159161
*
160162
* @throws \Grab\GrabfoodApiSdk\ApiException on non-2xx response or if the response body is not in the expected format
161163
* @throws \InvalidArgumentException
162164
* @return array of \Grab\GrabfoodApiSdk\Model\ListOrdersResponse, HTTP status code, HTTP response headers (array of strings)
163165
*/
164-
public function listOrdersWithHttpInfo($authorization, $merchant_id, $date, $page, string $contentType = self::contentTypes['listOrders'][0])
166+
public function listOrdersWithHttpInfo($authorization, $merchant_id, $date = null, $page = null, $order_ids = null, string $contentType = self::contentTypes['listOrders'][0])
165167
{
166-
$request = $this->listOrdersRequest($authorization, $merchant_id, $date, $page, $contentType);
168+
$request = $this->listOrdersRequest($authorization, $merchant_id, $date, $page, $order_ids, $contentType);
167169

168170
try {
169171
$options = $this->createHttpClientOption();
@@ -280,16 +282,17 @@ public function listOrdersWithHttpInfo($authorization, $merchant_id, $date, $pag
280282
*
281283
* @param string $authorization Specify the generated authorization token of the bearer type. (required)
282284
* @param string $merchant_id The merchant&#39;s ID that is in GrabFood&#39;s database. (required)
283-
* @param string $date (required)
284-
* @param int $page Specify the page number for the report. (required)
285+
* @param string $date (optional)
286+
* @param int $page Specify the page number for the report. Required if orderIDs is not provided. (optional)
287+
* @param string[] $order_ids List of order IDs. If provided, date and page are not required. (optional)
285288
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrders'] to see the possible values for this operation
286289
*
287290
* @throws \InvalidArgumentException
288291
* @return \GuzzleHttp\Promise\PromiseInterface
289292
*/
290-
public function listOrdersAsync($authorization, $merchant_id, $date, $page, string $contentType = self::contentTypes['listOrders'][0])
293+
public function listOrdersAsync($authorization, $merchant_id, $date = null, $page = null, $order_ids = null, string $contentType = self::contentTypes['listOrders'][0])
291294
{
292-
return $this->listOrdersAsyncWithHttpInfo($authorization, $merchant_id, $date, $page, $contentType)
295+
return $this->listOrdersAsyncWithHttpInfo($authorization, $merchant_id, $date, $page, $order_ids, $contentType)
293296
->then(
294297
function ($response) {
295298
return $response[0];
@@ -304,17 +307,18 @@ function ($response) {
304307
*
305308
* @param string $authorization Specify the generated authorization token of the bearer type. (required)
306309
* @param string $merchant_id The merchant&#39;s ID that is in GrabFood&#39;s database. (required)
307-
* @param string $date (required)
308-
* @param int $page Specify the page number for the report. (required)
310+
* @param string $date (optional)
311+
* @param int $page Specify the page number for the report. Required if orderIDs is not provided. (optional)
312+
* @param string[] $order_ids List of order IDs. If provided, date and page are not required. (optional)
309313
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrders'] to see the possible values for this operation
310314
*
311315
* @throws \InvalidArgumentException
312316
* @return \GuzzleHttp\Promise\PromiseInterface
313317
*/
314-
public function listOrdersAsyncWithHttpInfo($authorization, $merchant_id, $date, $page, string $contentType = self::contentTypes['listOrders'][0])
318+
public function listOrdersAsyncWithHttpInfo($authorization, $merchant_id, $date = null, $page = null, $order_ids = null, string $contentType = self::contentTypes['listOrders'][0])
315319
{
316320
$returnType = '\Grab\GrabfoodApiSdk\Model\ListOrdersResponse';
317-
$request = $this->listOrdersRequest($authorization, $merchant_id, $date, $page, $contentType);
321+
$request = $this->listOrdersRequest($authorization, $merchant_id, $date, $page, $order_ids, $contentType);
318322

319323
return $this->client
320324
->sendAsync($request, $this->createHttpClientOption())
@@ -357,14 +361,15 @@ function ($exception) {
357361
*
358362
* @param string $authorization Specify the generated authorization token of the bearer type. (required)
359363
* @param string $merchant_id The merchant&#39;s ID that is in GrabFood&#39;s database. (required)
360-
* @param string $date (required)
361-
* @param int $page Specify the page number for the report. (required)
364+
* @param string $date (optional)
365+
* @param int $page Specify the page number for the report. Required if orderIDs is not provided. (optional)
366+
* @param string[] $order_ids List of order IDs. If provided, date and page are not required. (optional)
362367
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['listOrders'] to see the possible values for this operation
363368
*
364369
* @throws \InvalidArgumentException
365370
* @return \GuzzleHttp\Psr7\Request
366371
*/
367-
public function listOrdersRequest($authorization, $merchant_id, $date, $page, string $contentType = self::contentTypes['listOrders'][0])
372+
public function listOrdersRequest($authorization, $merchant_id, $date = null, $page = null, $order_ids = null, string $contentType = self::contentTypes['listOrders'][0])
368373
{
369374

370375
// verify the required parameter 'authorization' is set
@@ -381,20 +386,12 @@ public function listOrdersRequest($authorization, $merchant_id, $date, $page, st
381386
);
382387
}
383388

384-
// verify the required parameter 'date' is set
385-
if ($date === null || (is_array($date) && count($date) === 0)) {
386-
throw new \InvalidArgumentException(
387-
'Missing the required parameter $date when calling listOrders'
388-
);
389-
}
390389

391-
// verify the required parameter 'page' is set
392-
if ($page === null || (is_array($page) && count($page) === 0)) {
393-
throw new \InvalidArgumentException(
394-
'Missing the required parameter $page when calling listOrders'
395-
);
396-
}
397390

391+
if ($order_ids !== null && count($order_ids) > 10) {
392+
throw new \InvalidArgumentException('invalid value for "$order_ids" when calling ListOrdersApi.listOrders, number of items must be less than or equal to 10.');
393+
}
394+
398395

399396
$resourcePath = '/partner/v1/orders';
400397
$formParams = [];
@@ -419,7 +416,7 @@ public function listOrdersRequest($authorization, $merchant_id, $date, $page, st
419416
'string', // openApiType
420417
'form', // style
421418
true, // explode
422-
true // required
419+
false // required
423420
) ?? []);
424421
// query params
425422
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
@@ -428,7 +425,16 @@ public function listOrdersRequest($authorization, $merchant_id, $date, $page, st
428425
'integer', // openApiType
429426
'form', // style
430427
true, // explode
431-
true // required
428+
false // required
429+
) ?? []);
430+
// query params
431+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
432+
$order_ids,
433+
'orderIDs', // param base name
434+
'array', // openApiType
435+
'form', // style
436+
true, // explode
437+
false // required
432438
) ?? []);
433439

434440
// header params

lib/Configuration.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Configuration
107107
*
108108
* @var string
109109
*/
110-
protected $userAgent = 'GrabFood-API-SDK/1.0.1/php';
110+
protected $userAgent = 'GrabFood-API-SDK/1.0.2/php';
111111

112112
/**
113113
* Debug switch (default set to false)
@@ -440,7 +440,7 @@ public static function toDebugReport()
440440
$report .= ' OS: ' . php_uname() . PHP_EOL;
441441
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
442442
$report .= ' The version of the OpenAPI document: 1.1.3' . PHP_EOL;
443-
$report .= ' SDK Package Version: 1.0.1' . PHP_EOL;
443+
$report .= ' SDK Package Version: 1.0.2' . PHP_EOL;
444444
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
445445

446446
return $report;

0 commit comments

Comments
 (0)