فهرست انتظار نمونه بار
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
BatchGetWaitEstimates
این مثال موردی را نشان میدهد که در آن یک رستوران معمولاً مقادیر party_size
از 2 تا 10 را مجاز میکند، اما در زمان درخواست، مقادیر party_size
بالاتر از 7 دیگر قابل استفاده نیستند (مثلاً نزدیک به زمان بسته شدن) و party_size
از 2 در واقع وجود ندارد. صبر کن
دریافت درخواست انتظار
{
"merchant_id": "dining-1",
"party_size": [2, 3, 4, 5, 6, 7, 8, 9, 10],
"service_id": "reservation"
}
پاسخ منتظر دریافت کنید
{
"waitlist_status": "OPEN",
"wait_estimate": [
{ "party_size": 2, "wait_length": {} },
{ "party_size": 3, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 4, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 5, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 6, "wait_length": { "parties_ahead_count": 3 } },
{ "party_size": 7, "wait_length": { "parties_ahead_count": 3 } }
]
}
CreateWaitlist Entry
درخواست ایجاد کنید
{
"idempotency_token": "14620365692592881354",
"merchant_id": "dining-1",
"party_size": 3,
"service_id": "reservation",
"user_information": {
"family_name": "John",
"given_name": "Smith",
"telephone": "+81 80-1111-2222",
"user_id": "123456789"
}
}
پاسخ ایجاد کنید
{ "waitlist_entry_id": "MYS-1668739060" }
GetWaitlistEntry
درخواست دریافت کنید
{ "waitlist_entry_id": "MYS-1668739060" }
پاسخ دریافت کنید
{
"waitlist_entry": {
"wait_estimate": {
"party_size": 3,
"wait_length": { "parties_ahead_count": 3 }
},
"waitlist_entry_state": "WAITING",
"waitlist_entry_state_times": { "created_time_seconds": 1234567890 }
}
}
حذف Waitlist Entry
حذف درخواست
{ "waitlist_entry_id": "MYS-1668739060" }
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eBatchGetWaitEstimates\u003c/code\u003e allows merchants to retrieve the current wait times for various party sizes for a specific service, such as reservations.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes a \u003ccode\u003ewaitlist_status\u003c/code\u003e indicating if the waitlist is open and a list of \u003ccode\u003ewait_estimate\u003c/code\u003e objects detailing the estimated wait for each party size, potentially using \u003ccode\u003eparties_ahead_count\u003c/code\u003e or remaining empty for immediate seating.\u003c/p\u003e\n"],["\u003cp\u003eUsing \u003ccode\u003eCreateWaitlistEntry\u003c/code\u003e, \u003ccode\u003eGetWaitlistEntry\u003c/code\u003e, and \u003ccode\u003eDeleteWaitlistEntry\u003c/code\u003e, users can add themselves to the waitlist, check their status and estimated wait, and remove themselves from the waitlist, respectively.\u003c/p\u003e\n"],["\u003cp\u003eWait estimates can vary based on real-time availability and operational constraints, such as party size limitations near closing time.\u003c/p\u003e\n"]]],["The provided content details waitlist management for a restaurant. It begins by checking wait estimates for party sizes 2-10, revealing that parties over 7 cannot be accommodated and party size 2 has no wait. A new waitlist entry is then created for a party of 3, assigning it an ID. Retrieving that ID confirms the party is waiting with 3 parties ahead. Finally the entry is deleted.\n"],null,["# Waitlists Payload Sample\n\n### BatchGetWaitEstimates\n\n\nThis example illustrates a case where a restaurant usually allows `party_size` values\nfrom 2 to 10 but at the time of the request, `party_size` values higher than 7 can no\nlonger be accomodated (close to closing time, for example) and `party_size` of 2 has\nactually no wait. \n\n### Get wait request\n\n```scdoc\n{\n \"merchant_id\": \"dining-1\",\n \"party_size\": [2, 3, 4, 5, 6, 7, 8, 9, 10],\n \"service_id\": \"reservation\"\n}\n```\n\n### Get wait response\n\n```scdoc\n{\n \"waitlist_status\": \"OPEN\",\n \"wait_estimate\": [\n { \"party_size\": 2, \"wait_length\": {} },\n { \"party_size\": 3, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 4, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 5, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 6, \"wait_length\": { \"parties_ahead_count\": 3 } },\n { \"party_size\": 7, \"wait_length\": { \"parties_ahead_count\": 3 } }\n ]\n}\n```\n\n### CreateWaitlistEntry\n\n### Create request\n\n```scdoc\n{\n \"idempotency_token\": \"14620365692592881354\",\n \"merchant_id\": \"dining-1\",\n \"party_size\": 3,\n \"service_id\": \"reservation\",\n \"user_information\": {\n \"family_name\": \"John\",\n \"given_name\": \"Smith\",\n \"telephone\": \"+81 80-1111-2222\",\n \"user_id\": \"123456789\"\n }\n}\n```\n\n### Create response\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### GetWaitlistEntry\n\n### Get request\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### Get response\n\n```scdoc\n{\n \"waitlist_entry\": {\n \"wait_estimate\": {\n \"party_size\": 3,\n \"wait_length\": { \"parties_ahead_count\": 3 }\n },\n \"waitlist_entry_state\": \"WAITING\",\n \"waitlist_entry_state_times\": { \"created_time_seconds\": 1234567890 }\n }\n}\n```\n\n### DeleteWaitlistEntry\n\n### Delete request\n\n```scdoc\n{ \"waitlist_entry_id\": \"MYS-1668739060\" }\n```\n\n### Delete response\n\n```text\n{}\n```"]]