Skip to content

Commit c96774b

Browse files
Merge branch 'ml/BP-21748/v102' into 'main'
Release 1.0.2 Closes BP-21748 See merge request grab-transport/mex/store-ops/openapi-sdk/grabfood-api-sdk-python!11
2 parents cb63d9f + fa85189 commit c96774b

10 files changed

+58
-26
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-python/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
@@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: 1.1.3
7-
- Package version: 1.0.1
7+
- Package version: 1.0.2
88
- Generator version: 7.8.0
99
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1010
For more information, please visit [https://developer.grab.com](https://developer.grab.com)

docs/ListOrdersApi.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Method | HTTP request | Description
88

99

1010
# **list_orders**
11-
> ListOrdersResponse list_orders(authorization, merchant_id, var_date, page)
11+
> ListOrdersResponse list_orders(authorization, merchant_id, var_date=var_date, page=page, order_ids=order_ids)
1212
1313
List orders
1414

@@ -34,12 +34,13 @@ with grabfood.ApiClient(configuration) as api_client:
3434
api_instance = grabfood.ListOrdersApi(api_client)
3535
authorization = 'Bearer <ACCESS_TOKEN_HERE>' # str | Specify the generated authorization token of the bearer type.
3636
merchant_id = '1-CYNGRUNGSBCCC' # str | The merchant's ID that is in GrabFood's database.
37-
var_date = 'var_date_example' # str |
38-
page = 1 # int | Specify the page number for the report.
37+
var_date = 'var_date_example' # str | (optional)
38+
page = 1 # int | Specify the page number for the report. Required if orderIDs is not provided. (optional)
39+
order_ids = ['[\"123-CYNKLPCVRN5\",\"456-PCVRN5CYNKL\"]'] # List[str] | List of order IDs. If provided, date and page are not required. (optional)
3940

4041
try:
4142
# List orders
42-
api_response = api_instance.list_orders(authorization, merchant_id, var_date, page)
43+
api_response = api_instance.list_orders(authorization, merchant_id, var_date=var_date, page=page, order_ids=order_ids)
4344
print("The response of ListOrdersApi->list_orders:\n")
4445
pprint(api_response)
4546
except Exception as e:
@@ -55,8 +56,9 @@ Name | Type | Description | Notes
5556
------------- | ------------- | ------------- | -------------
5657
**authorization** | **str**| Specify the generated authorization token of the bearer type. |
5758
**merchant_id** | **str**| The merchant&#39;s ID that is in GrabFood&#39;s database. |
58-
**var_date** | **str**| |
59-
**page** | **int**| Specify the page number for the report. |
59+
**var_date** | **str**| | [optional]
60+
**page** | **int**| Specify the page number for the report. Required if orderIDs is not provided. | [optional]
61+
**order_ids** | [**List[str]**](str.md)| List of order IDs. If provided, date and page are not required. | [optional]
6062

6163
### Return type
6264

grabfood/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"""
1717

1818

19-
__version__ = "1.0.1"
19+
__version__ = "1.0.2"
2020

2121
# import apis into sdk package
2222
from grabfood.api.accept_reject_order_api import AcceptRejectOrderApi

grabfood/api/list_orders_api.py

+31-12
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from typing_extensions import Annotated
2020

2121
from pydantic import Field, StrictInt, StrictStr
22+
from typing import List, Optional
2223
from typing_extensions import Annotated
2324
from grabfood.models.list_orders_response import ListOrdersResponse
2425

@@ -45,8 +46,9 @@ def list_orders(
4546
self,
4647
authorization: Annotated[StrictStr, Field(description="Specify the generated authorization token of the bearer type.")],
4748
merchant_id: Annotated[StrictStr, Field(description="The merchant's ID that is in GrabFood's database.")],
48-
var_date: StrictStr,
49-
page: Annotated[StrictInt, Field(description="Specify the page number for the report.")],
49+
var_date: Optional[StrictStr] = None,
50+
page: Annotated[Optional[StrictInt], Field(description="Specify the page number for the report. Required if orderIDs is not provided.")] = None,
51+
order_ids: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=10)]], Field(description="List of order IDs. If provided, date and page are not required.")] = None,
5052
_request_timeout: Union[
5153
None,
5254
Annotated[StrictFloat, Field(gt=0)],
@@ -67,10 +69,12 @@ def list_orders(
6769
:type authorization: str
6870
:param merchant_id: The merchant's ID that is in GrabFood's database. (required)
6971
:type merchant_id: str
70-
:param var_date: (required)
72+
:param var_date:
7173
:type var_date: str
72-
:param page: Specify the page number for the report. (required)
74+
:param page: Specify the page number for the report. Required if orderIDs is not provided.
7375
:type page: int
76+
:param order_ids: List of order IDs. If provided, date and page are not required.
77+
:type order_ids: List[str]
7478
:param _request_timeout: timeout setting for this request. If one
7579
number provided, it will be total request
7680
timeout. It can also be a pair (tuple) of
@@ -98,6 +102,7 @@ def list_orders(
98102
merchant_id=merchant_id,
99103
var_date=var_date,
100104
page=page,
105+
order_ids=order_ids,
101106
_request_auth=_request_auth,
102107
_content_type=_content_type,
103108
_headers=_headers,
@@ -123,8 +128,9 @@ def list_orders_with_http_info(
123128
self,
124129
authorization: Annotated[StrictStr, Field(description="Specify the generated authorization token of the bearer type.")],
125130
merchant_id: Annotated[StrictStr, Field(description="The merchant's ID that is in GrabFood's database.")],
126-
var_date: StrictStr,
127-
page: Annotated[StrictInt, Field(description="Specify the page number for the report.")],
131+
var_date: Optional[StrictStr] = None,
132+
page: Annotated[Optional[StrictInt], Field(description="Specify the page number for the report. Required if orderIDs is not provided.")] = None,
133+
order_ids: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=10)]], Field(description="List of order IDs. If provided, date and page are not required.")] = None,
128134
_request_timeout: Union[
129135
None,
130136
Annotated[StrictFloat, Field(gt=0)],
@@ -145,10 +151,12 @@ def list_orders_with_http_info(
145151
:type authorization: str
146152
:param merchant_id: The merchant's ID that is in GrabFood's database. (required)
147153
:type merchant_id: str
148-
:param var_date: (required)
154+
:param var_date:
149155
:type var_date: str
150-
:param page: Specify the page number for the report. (required)
156+
:param page: Specify the page number for the report. Required if orderIDs is not provided.
151157
:type page: int
158+
:param order_ids: List of order IDs. If provided, date and page are not required.
159+
:type order_ids: List[str]
152160
:param _request_timeout: timeout setting for this request. If one
153161
number provided, it will be total request
154162
timeout. It can also be a pair (tuple) of
@@ -176,6 +184,7 @@ def list_orders_with_http_info(
176184
merchant_id=merchant_id,
177185
var_date=var_date,
178186
page=page,
187+
order_ids=order_ids,
179188
_request_auth=_request_auth,
180189
_content_type=_content_type,
181190
_headers=_headers,
@@ -201,8 +210,9 @@ def list_orders_without_preload_content(
201210
self,
202211
authorization: Annotated[StrictStr, Field(description="Specify the generated authorization token of the bearer type.")],
203212
merchant_id: Annotated[StrictStr, Field(description="The merchant's ID that is in GrabFood's database.")],
204-
var_date: StrictStr,
205-
page: Annotated[StrictInt, Field(description="Specify the page number for the report.")],
213+
var_date: Optional[StrictStr] = None,
214+
page: Annotated[Optional[StrictInt], Field(description="Specify the page number for the report. Required if orderIDs is not provided.")] = None,
215+
order_ids: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=10)]], Field(description="List of order IDs. If provided, date and page are not required.")] = None,
206216
_request_timeout: Union[
207217
None,
208218
Annotated[StrictFloat, Field(gt=0)],
@@ -223,10 +233,12 @@ def list_orders_without_preload_content(
223233
:type authorization: str
224234
:param merchant_id: The merchant's ID that is in GrabFood's database. (required)
225235
:type merchant_id: str
226-
:param var_date: (required)
236+
:param var_date:
227237
:type var_date: str
228-
:param page: Specify the page number for the report. (required)
238+
:param page: Specify the page number for the report. Required if orderIDs is not provided.
229239
:type page: int
240+
:param order_ids: List of order IDs. If provided, date and page are not required.
241+
:type order_ids: List[str]
230242
:param _request_timeout: timeout setting for this request. If one
231243
number provided, it will be total request
232244
timeout. It can also be a pair (tuple) of
@@ -254,6 +266,7 @@ def list_orders_without_preload_content(
254266
merchant_id=merchant_id,
255267
var_date=var_date,
256268
page=page,
269+
order_ids=order_ids,
257270
_request_auth=_request_auth,
258271
_content_type=_content_type,
259272
_headers=_headers,
@@ -276,6 +289,7 @@ def _list_orders_serialize(
276289
merchant_id,
277290
var_date,
278291
page,
292+
order_ids,
279293
_request_auth,
280294
_content_type,
281295
_headers,
@@ -285,6 +299,7 @@ def _list_orders_serialize(
285299
_host = None
286300

287301
_collection_formats: Dict[str, str] = {
302+
'orderIDs': 'multi',
288303
}
289304

290305
_path_params: Dict[str, str] = {}
@@ -308,6 +323,10 @@ def _list_orders_serialize(
308323

309324
_query_params.append(('page', page))
310325

326+
if order_ids is not None:
327+
328+
_query_params.append(('orderIDs', order_ids))
329+
311330
# process the header parameters
312331
if authorization is not None:
313332
_header_params['Authorization'] = authorization

grabfood/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
self.default_headers[header_name] = header_value
9393
self.cookie = cookie
9494
# Set default User-Agent.
95-
self.user_agent = 'GrabFood-API-SDK/1.0.1/python'
95+
self.user_agent = 'GrabFood-API-SDK/1.0.2/python'
9696
self.client_side_validation = configuration.client_side_validation
9797

9898
def __enter__(self):

grabfood/configs/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
STG_ENV = "https://partner-api.stg-myteksi.com/grabfood" # Staging environment for self serve onboarding partner
1+
STG_ENV = "https://partner-api.grab.com/grabfood-sandbox" # Staging environment for self serve onboarding partner
22
PRD_ENV = "https://partner-api.grab.com/grabfood" # Production environment
3-
STG_AUTH_ENV = "https://api.stg-myteksi.com" # Staging environment authentication
3+
STG_AUTH_ENV = "https://api.grab.com" # Staging environment authentication
44
PRD_AUTH_ENV = "https://api.grab.com" # Production environment authentication

grabfood/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def to_debug_report(self):
386386
"OS: {env}\n"\
387387
"Python Version: {pyversion}\n"\
388388
"Version of the API: 1.1.3\n"\
389-
"SDK Package Version: 1.0.1".\
389+
"SDK Package Version: 1.0.2".\
390390
format(env=sys.platform, pyversion=sys.version)
391391

392392
def get_host_settings(self):

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "grabfood"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
description = "GrabFood"
55
authors = ["Grab Developer"]
66
license = "MIT License"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# prerequisite: setuptools
2424
# http://pypi.python.org/pypi/setuptools
2525
NAME = "grabfood"
26-
VERSION = "1.0.1"
26+
VERSION = "1.0.2"
2727
PYTHON_REQUIRES = ">=3.7"
2828
REQUIRES = [
2929
"urllib3 >= 1.25.3, < 2.1.0",

0 commit comments

Comments
 (0)