Bekleme Listeleri Yük Örneği
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
BatchGetWaitEstimates
Bu örnekte, bir restoranın genellikle 2 ila 10 arasında party_size
değerlerine izin verdiği ancak istek sırasında 7'den yüksek party_size
değerlerine artık izin verilmediği (ör. kapanma saatine yakın) ve 2 kişilik party_size
için aslında bekleme olmadığı bir durum gösterilmektedir.
Bekleme isteği alma
{
"merchant_id": "dining-1",
"party_size": [2, 3, 4, 5, 6, 7, 8, 9, 10],
"service_id": "reservation"
}
Bekle yanıtını alma
{
"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 } }
]
}
CreateWaitlistEntry
İstek oluştur
{
"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"
}
}
Yanıt oluşturma
{ "waitlist_entry_id": "MYS-1668739060" }
GetWaitlistEntry
GET isteği
{ "waitlist_entry_id": "MYS-1668739060" }
Yanıt alma
{
"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 }
}
}
DeleteWaitlistEntry
İsteği silin
{ "waitlist_entry_id": "MYS-1668739060" }
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\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```"]]