Skip to content

Commit 5895e99

Browse files
Initial commit
0 parents  commit 5895e99

File tree

295 files changed

+81195
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+81195
-0
lines changed

.gitignore

+477
Large diffs are not rendered by default.

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## [1.0.1] - 2025-02-24
4+
5+
### Added
6+
7+
- Initial release of the project.

CONTRIBUTING.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing to Our Project's SDK
2+
3+
We value your input and contributions! We use the [OpenAPI Generator tool](https://openapi-generator.tech) to generate our SDK based on an OpenAPI YAML specification.
4+
5+
If you find an issue with our SDK and want to contribute a fix, follow the guidelines mentioned below:
6+
7+
## Reporting an Issue
8+
9+
1. Notice an issue while using the SDK? Try to determine what's causing it. Was it a particular endpoint, operation, or datatype?
10+
11+
2. Check the YAML specification: Once you've identified the issue, refer to the corresponding definition in the OpenAPI YAML specification file that is included in the SDK. This could be a specific path, operation, parameter, or schema.
12+
13+
3. Describe the current behavior and desired correct behavior.
14+
15+
4. Describe the steps to reproduce this issue.
16+
17+
Please note that due to our open-source process, we don't have a direct way to accept code contributions for the SDK. The SDK is directly generated from our OpenAPI YAML specification file. Hence, you don't need to manually update the SDK. Instead, identify the modifications needed in the OpenAPI YAML specification.
18+
19+
## Submitting a Suggestion
20+
21+
If there's something in the SDK that isn't broken but could be better, you're welcome to share suggestions. Constructive feedback is always appreciated!
22+
23+
When submitting a suggestion:
24+
25+
1. Be clear and concise in your description of the suggestion.
26+
27+
2. Explain why it would be beneficial. Real-life examples, if applicable, can help to illustrate your point.
28+
29+
3. Be patient. Not all suggestions can be incorporated immediately, and it may be necessary for us to research your idea before we can implement it.
30+
31+
Remember, contributions come in many forms, not just in code! Identifying areas for improvement or bringing up issues helps us make the SDK better for everyone.
32+
33+
Thank you for your contributions!

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2024 Grabtaxi Holdings PTE LTE (GRAB)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+262
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
# grabfood
2+
3+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4+
5+
For more information, please visit [https://developer.grab.com](https://developer.grab.com).
6+
7+
## Installation & Usage
8+
9+
### Requirements
10+
11+
PHP 7.4 and later.
12+
Should also work with PHP 8.0.
13+
14+
### Composer
15+
16+
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
17+
18+
```json
19+
{
20+
"repositories": [
21+
{
22+
"type": "vcs",
23+
"url": "https://github.com/grab/grabfood-api-sdk-php.git"
24+
}
25+
],
26+
"require": {
27+
"grab/grabfood-api-sdk-php": "*@dev"
28+
}
29+
}
30+
```
31+
32+
Then run `composer install`
33+
34+
### Manual Installation
35+
36+
Download the files and include `autoload.php`:
37+
38+
```php
39+
<?php
40+
require_once('/path/to/grabfood/vendor/autoload.php');
41+
```
42+
43+
## Getting Started
44+
45+
Please follow the [installation procedure](#installation--usage) and then run the following:
46+
47+
```php
48+
<?php
49+
require_once(__DIR__ . '/vendor/autoload.php');
50+
51+
52+
53+
54+
$apiInstance = new Grab\GrabfoodApiSdk\Api\AcceptRejectOrderApi(
55+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
56+
// This is optional, `GuzzleHttp\Client` will be used as default.
57+
new GuzzleHttp\Client()
58+
);
59+
$authorization = Bearer <ACCESS_TOKEN_HERE>; // string | Specify the generated authorization token of the bearer type.
60+
$content_type = application/json; // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats.
61+
$accept_order_request = new \Grab\GrabfoodApiSdk\Model\AcceptOrderRequest(); // \Grab\GrabfoodApiSdk\Model\AcceptOrderRequest |
62+
63+
try {
64+
$apiInstance->acceptRejectOrder($authorization, $content_type, $accept_order_request);
65+
} catch (Exception $e) {
66+
echo 'Exception when calling AcceptRejectOrderApi->acceptRejectOrder: ', $e->getMessage(), PHP_EOL;
67+
}
68+
69+
```
70+
71+
## Environment Configuration
72+
73+
The SDK supports both staging and production environments. You can switch between environments by modifying the host settings parameter:
74+
75+
```php
76+
use OpenAPI\Client\Configuration;
77+
$config = Configuration::getDefaultConfiguration()
78+
79+
// Staging Environment (default)
80+
$config->setHost($config->getHostFromSettings(Configuration::StgEnv));
81+
82+
// Production Environment
83+
$config->setHost($config->getHostFromSettings(Configuration::PrdEnv));
84+
```
85+
86+
## API Endpoints
87+
88+
All URIs are relative to *https://partner-api.grab.com/grabfood-sandbox*
89+
90+
Class | Method | HTTP request | Description
91+
------------ | ------------- | ------------- | -------------
92+
*AcceptRejectOrderApi* | [**acceptRejectOrder**](docs/Api/AcceptRejectOrderApi.md#acceptrejectorder) | **POST** /partner/v1/order/prepare | Manually accept/reject orders
93+
*CancelOrderApi* | [**cancelOrder**](docs/Api/CancelOrderApi.md#cancelorder) | **PUT** /partner/v1/order/cancel | Cancel an order
94+
*CheckOrderCancelableApi* | [**checkOrderCancelable**](docs/Api/CheckOrderCancelableApi.md#checkordercancelable) | **GET** /partner/v1/order/cancelable | Check order cancelable
95+
*CreateCampaignApi* | [**createCampaign**](docs/Api/CreateCampaignApi.md#createcampaign) | **POST** /partner/v1/campaigns | Create campaign
96+
*CreateSelfServeJourneyApi* | [**createSelfServeJourney**](docs/Api/CreateSelfServeJourneyApi.md#createselfservejourney) | **POST** /partner/v1/self-serve/activation | Create self serve journey
97+
*DeleteCampaignApi* | [**deleteCampaign**](docs/Api/DeleteCampaignApi.md#deletecampaign) | **DELETE** /partner/v1/campaigns/{campaign_id} | Delete campaigns
98+
*EditOrderApi* | [**editOrder**](docs/Api/EditOrderApi.md#editorder) | **PUT** /partner/v1/orders/{orderID} | Edit Order
99+
*GetDineinVoucherApi* | [**getDineinVoucher**](docs/Api/GetDineinVoucherApi.md#getdineinvoucher) | **GET** /partner/v1/dinein/voucher | Get Dine In Voucher
100+
*GetOauthGrabApi* | [**getOauthGrab**](docs/Api/GetOauthGrabApi.md#getoauthgrab) | **POST** /grabid/v1/oauth2/token | Get Oauth access token
101+
*GetStoreHourApi* | [**getStoreHour**](docs/Api/GetStoreHourApi.md#getstorehour) | **GET** /partner/v2/merchants/{merchantID}/store/hours | Get Store Hours
102+
*GetStoreStatusApi* | [**getStoreStatus**](docs/Api/GetStoreStatusApi.md#getstorestatus) | **GET** /partner/v1/merchants/{merchantID}/store/status | Get Store Status
103+
*ListCampaignApi* | [**listCampaign**](docs/Api/ListCampaignApi.md#listcampaign) | **GET** /partner/v1/campaigns | List campaigns
104+
*ListOrdersApi* | [**listOrders**](docs/Api/ListOrdersApi.md#listorders) | **GET** /partner/v1/orders | List orders
105+
*MarkOrderReadyApi* | [**markOrderReady**](docs/Api/MarkOrderReadyApi.md#markorderready) | **POST** /partner/v1/orders/mark | Mark order as ready
106+
*NotifyMembershipWebviewApi* | [**notifyMembershipWebview**](docs/Api/NotifyMembershipWebviewApi.md#notifymembershipwebview) | **POST** /partner/v1/membership/notify | Notify Membership
107+
*PauseStoreApi* | [**pauseStore**](docs/Api/PauseStoreApi.md#pausestore) | **PUT** /partner/v1/merchant/pause | Pause store
108+
*RedeemDineinVoucherApi* | [**redeemDineinVoucher**](docs/Api/RedeemDineinVoucherApi.md#redeemdineinvoucher) | **POST** /partner/v1/dinein/voucher/redeem | Redeem Dine In Voucher
109+
*TraceMenuSyncApi* | [**traceMenuSync**](docs/Api/TraceMenuSyncApi.md#tracemenusync) | **GET** /partner/v1/merchant/menu/trace | Trace menu sync
110+
*UpdateCampaignApi* | [**updateCampaign**](docs/Api/UpdateCampaignApi.md#updatecampaign) | **PUT** /partner/v1/campaigns/{campaign_id} | Update campaign
111+
*UpdateDeliveryStateApi* | [**updateDeliveryState**](docs/Api/UpdateDeliveryStateApi.md#updatedeliverystate) | **POST** /partner/v1/order/delivery | Update delivery state
112+
*UpdateMenuNotificationApi* | [**updateMenuNotification**](docs/Api/UpdateMenuNotificationApi.md#updatemenunotification) | **POST** /partner/v1/merchant/menu/notification | Notify Grab of updated menu
113+
*UpdateMenuRecordApi* | [**batchUpdateMenu**](docs/Api/UpdateMenuRecordApi.md#batchupdatemenu) | **PUT** /partner/v1/batch/menu | Batch Update Menu
114+
*UpdateMenuRecordApi* | [**updateMenu**](docs/Api/UpdateMenuRecordApi.md#updatemenu) | **PUT** /partner/v1/menu | Update menu record
115+
*UpdateOrderReadyTimeApi* | [**updateOrderReadyTime**](docs/Api/UpdateOrderReadyTimeApi.md#updateorderreadytime) | **PUT** /partner/v1/order/readytime | Update new order ready time
116+
*UpdateStoreDeliveryHourApi* | [**updateStoreDeliveryHour**](docs/Api/UpdateStoreDeliveryHourApi.md#updatestoredeliveryhour) | **PUT** /partner/v1/merchants/{merchantID}/store/opening-hours | Update Store Delivery Hours
117+
*UpdateStoreDineInHourApi* | [**updateStoreDineInHour**](docs/Api/UpdateStoreDineInHourApi.md#updatestoredineinhour) | **PUT** /partner/v1/merchants/{merchantID}/store/dine-in-hours | Update Store Dine-in Hours
118+
*UpdateStoreSpecialHourApi* | [**updateStoreSpecialHour**](docs/Api/UpdateStoreSpecialHourApi.md#updatestorespecialhour) | **PUT** /partner/v2/merchants/{merchantID}/store/special-opening-hour | Update Store Special Hours
119+
120+
## Models
121+
122+
- [AcceptOrderRequest](docs/Model/AcceptOrderRequest.md)
123+
- [Address](docs/Model/Address.md)
124+
- [AdvancedPricing](docs/Model/AdvancedPricing.md)
125+
- [BatchUpdateMenuItem](docs/Model/BatchUpdateMenuItem.md)
126+
- [BatchUpdateMenuResponse](docs/Model/BatchUpdateMenuResponse.md)
127+
- [BindMembershipNativeRequest](docs/Model/BindMembershipNativeRequest.md)
128+
- [BindMembershipNativeResponse](docs/Model/BindMembershipNativeResponse.md)
129+
- [Campaign](docs/Model/Campaign.md)
130+
- [CampaignConditions](docs/Model/CampaignConditions.md)
131+
- [CampaignDiscount](docs/Model/CampaignDiscount.md)
132+
- [CampaignQuotas](docs/Model/CampaignQuotas.md)
133+
- [CampaignScope](docs/Model/CampaignScope.md)
134+
- [CancelCode](docs/Model/CancelCode.md)
135+
- [CancelOrderLimitType](docs/Model/CancelOrderLimitType.md)
136+
- [CancelOrderRequest](docs/Model/CancelOrderRequest.md)
137+
- [CancelOrderResponse](docs/Model/CancelOrderResponse.md)
138+
- [CancelReason](docs/Model/CancelReason.md)
139+
- [CheckOrderCancelableResponse](docs/Model/CheckOrderCancelableResponse.md)
140+
- [Coordinates](docs/Model/Coordinates.md)
141+
- [CreateCampaignRequest](docs/Model/CreateCampaignRequest.md)
142+
- [CreateCampaignResponse](docs/Model/CreateCampaignResponse.md)
143+
- [CreateSelfServeJourneyRequest](docs/Model/CreateSelfServeJourneyRequest.md)
144+
- [CreateSelfServeJourneyRequestPartner](docs/Model/CreateSelfServeJourneyRequestPartner.md)
145+
- [CreateSelfServeJourneyResponse](docs/Model/CreateSelfServeJourneyResponse.md)
146+
- [Currency](docs/Model/Currency.md)
147+
- [DineIn](docs/Model/DineIn.md)
148+
- [EditOrderItem](docs/Model/EditOrderItem.md)
149+
- [EditOrderRequest](docs/Model/EditOrderRequest.md)
150+
- [Error](docs/Model/Error.md)
151+
- [GetDineInVoucherResponse](docs/Model/GetDineInVoucherResponse.md)
152+
- [GetMembershipNativeResponse](docs/Model/GetMembershipNativeResponse.md)
153+
- [GetMembershipNativeResponsePointInfo](docs/Model/GetMembershipNativeResponsePointInfo.md)
154+
- [GetMembershipRequest](docs/Model/GetMembershipRequest.md)
155+
- [GetMembershipWebviewResponse](docs/Model/GetMembershipWebviewResponse.md)
156+
- [GetMenuNewResponse](docs/Model/GetMenuNewResponse.md)
157+
- [GetMenuOldResponse](docs/Model/GetMenuOldResponse.md)
158+
- [GetRewardNativeRequest](docs/Model/GetRewardNativeRequest.md)
159+
- [GetRewardNativeResponse](docs/Model/GetRewardNativeResponse.md)
160+
- [GrabOauthRequest](docs/Model/GrabOauthRequest.md)
161+
- [GrabOauthResponse](docs/Model/GrabOauthResponse.md)
162+
- [ListCampaignResponse](docs/Model/ListCampaignResponse.md)
163+
- [ListOrdersResponse](docs/Model/ListOrdersResponse.md)
164+
- [MarkOrderRequest](docs/Model/MarkOrderRequest.md)
165+
- [MenuCategory](docs/Model/MenuCategory.md)
166+
- [MenuEntity](docs/Model/MenuEntity.md)
167+
- [MenuEntityError](docs/Model/MenuEntityError.md)
168+
- [MenuItem](docs/Model/MenuItem.md)
169+
- [MenuModifier](docs/Model/MenuModifier.md)
170+
- [MenuSection](docs/Model/MenuSection.md)
171+
- [MenuSectionCategory](docs/Model/MenuSectionCategory.md)
172+
- [MenuSectionCategoryItem](docs/Model/MenuSectionCategoryItem.md)
173+
- [MenuSyncFail](docs/Model/MenuSyncFail.md)
174+
- [MenuSyncFailCategory](docs/Model/MenuSyncFailCategory.md)
175+
- [MenuSyncFailItem](docs/Model/MenuSyncFailItem.md)
176+
- [MenuSyncFailModifier](docs/Model/MenuSyncFailModifier.md)
177+
- [MenuSyncFailModifierGroup](docs/Model/MenuSyncFailModifierGroup.md)
178+
- [MenuSyncFailServiceHours](docs/Model/MenuSyncFailServiceHours.md)
179+
- [MenuSyncResponse](docs/Model/MenuSyncResponse.md)
180+
- [MenuSyncWebhookRequest](docs/Model/MenuSyncWebhookRequest.md)
181+
- [ModifierGroup](docs/Model/ModifierGroup.md)
182+
- [NewOrderTimeRequest](docs/Model/NewOrderTimeRequest.md)
183+
- [NotifyMembershipWebviewRequest](docs/Model/NotifyMembershipWebviewRequest.md)
184+
- [OpenPeriod](docs/Model/OpenPeriod.md)
185+
- [Order](docs/Model/Order.md)
186+
- [OrderCampaign](docs/Model/OrderCampaign.md)
187+
- [OrderDeliveryRequest](docs/Model/OrderDeliveryRequest.md)
188+
- [OrderFeatureFlags](docs/Model/OrderFeatureFlags.md)
189+
- [OrderFreeItem](docs/Model/OrderFreeItem.md)
190+
- [OrderItem](docs/Model/OrderItem.md)
191+
- [OrderItemModifier](docs/Model/OrderItemModifier.md)
192+
- [OrderPrice](docs/Model/OrderPrice.md)
193+
- [OrderPromo](docs/Model/OrderPromo.md)
194+
- [OrderReadyEstimation](docs/Model/OrderReadyEstimation.md)
195+
- [OrderStateRequest](docs/Model/OrderStateRequest.md)
196+
- [OutOfStockInstruction](docs/Model/OutOfStockInstruction.md)
197+
- [PartnerOauthRequest](docs/Model/PartnerOauthRequest.md)
198+
- [PartnerOauthResponse](docs/Model/PartnerOauthResponse.md)
199+
- [PauseStoreRequest](docs/Model/PauseStoreRequest.md)
200+
- [Purchasability](docs/Model/Purchasability.md)
201+
- [PushIntegrationStatusWebhookRequest](docs/Model/PushIntegrationStatusWebhookRequest.md)
202+
- [Receiver](docs/Model/Receiver.md)
203+
- [RedeemDineInVoucherRequest](docs/Model/RedeemDineInVoucherRequest.md)
204+
- [RedeemDineInVoucherResponse](docs/Model/RedeemDineInVoucherResponse.md)
205+
- [RedeemResult](docs/Model/RedeemResult.md)
206+
- [RegisterMembershipNativeRequest](docs/Model/RegisterMembershipNativeRequest.md)
207+
- [RegisterMembershipNativeResponse](docs/Model/RegisterMembershipNativeResponse.md)
208+
- [RewardItem](docs/Model/RewardItem.md)
209+
- [SellingTime](docs/Model/SellingTime.md)
210+
- [ServiceHour](docs/Model/ServiceHour.md)
211+
- [ServiceHours](docs/Model/ServiceHours.md)
212+
- [SpecialOpeningHour](docs/Model/SpecialOpeningHour.md)
213+
- [SpecialOpeningHourMetadata](docs/Model/SpecialOpeningHourMetadata.md)
214+
- [SpecialOpeningHourOpeningHours](docs/Model/SpecialOpeningHourOpeningHours.md)
215+
- [StoreHour](docs/Model/StoreHour.md)
216+
- [StoreHourResponse](docs/Model/StoreHourResponse.md)
217+
- [StoreStatusResponse](docs/Model/StoreStatusResponse.md)
218+
- [SubmitOrderRequest](docs/Model/SubmitOrderRequest.md)
219+
- [UnbindMembershipNativeRequest](docs/Model/UnbindMembershipNativeRequest.md)
220+
- [UnlinkMembershipWebviewRequest](docs/Model/UnlinkMembershipWebviewRequest.md)
221+
- [UpdateAdvancedPricing](docs/Model/UpdateAdvancedPricing.md)
222+
- [UpdateCampaignRequest](docs/Model/UpdateCampaignRequest.md)
223+
- [UpdateDeliveryHourRequest](docs/Model/UpdateDeliveryHourRequest.md)
224+
- [UpdateDeliveryHourResponse](docs/Model/UpdateDeliveryHourResponse.md)
225+
- [UpdateDineInHourRequest](docs/Model/UpdateDineInHourRequest.md)
226+
- [UpdateDineInHourResponse](docs/Model/UpdateDineInHourResponse.md)
227+
- [UpdateMenuItem](docs/Model/UpdateMenuItem.md)
228+
- [UpdateMenuModifier](docs/Model/UpdateMenuModifier.md)
229+
- [UpdateMenuNotifRequest](docs/Model/UpdateMenuNotifRequest.md)
230+
- [UpdateMenuRequest](docs/Model/UpdateMenuRequest.md)
231+
- [UpdatePurchasability](docs/Model/UpdatePurchasability.md)
232+
- [UpdateSpecialHourRequest](docs/Model/UpdateSpecialHourRequest.md)
233+
- [UpdateSpecialHourResponse](docs/Model/UpdateSpecialHourResponse.md)
234+
- [Voucher](docs/Model/Voucher.md)
235+
- [VoucherDescriptionInfo](docs/Model/VoucherDescriptionInfo.md)
236+
- [WorkingHour](docs/Model/WorkingHour.md)
237+
- [WorkingHourDay](docs/Model/WorkingHourDay.md)
238+
239+
## Authorization
240+
Endpoints do not require authorization.
241+
242+
## Tests
243+
244+
To run the tests, use:
245+
246+
```bash
247+
composer install
248+
vendor/bin/phpunit
249+
```
250+
251+
## Author
252+
253+
254+
255+
## About this package
256+
257+
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
258+
259+
- API version: `1.1.3`
260+
- Package version: `1.0.1`
261+
- Generator version: `7.8.0`
262+
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

composer.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "grab/grabfood-api-sdk-php",
3+
"version": "1.0.1",
4+
"description": "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)",
5+
"keywords": [
6+
"openapitools",
7+
"openapi-generator",
8+
"openapi",
9+
"php",
10+
"sdk",
11+
"rest",
12+
"api"
13+
],
14+
"homepage": "https://openapi-generator.tech",
15+
"license": "MIT License",
16+
"authors": [
17+
{
18+
"name": "Grab Developer",
19+
"homepage": "https://developer.grab.com"
20+
}
21+
],
22+
"require": {
23+
"php": "^7.4 || ^8.0",
24+
"ext-curl": "*",
25+
"ext-json": "*",
26+
"ext-mbstring": "*",
27+
"guzzlehttp/guzzle": "^7.3",
28+
"guzzlehttp/psr7": "^1.7 || ^2.0"
29+
},
30+
"require-dev": {
31+
"phpunit/phpunit": "^8.0 || ^9.0",
32+
"friendsofphp/php-cs-fixer": "^3.5"
33+
},
34+
"autoload": {
35+
"psr-4": { "Grab\\GrabfoodApiSdk\\" : "lib/" }
36+
},
37+
"autoload-dev": {
38+
"psr-4": { "Grab\\GrabfoodApiSdk\\Test\\" : "test/" }
39+
}
40+
}

0 commit comments

Comments
 (0)