BatchGetWaitEstimates का तरीका
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
अनुरोध किए गए कारोबारी/कंपनी/कारोबारी इकाई, सेवा, और ग्राहकों की संख्या के लिए,
WaitEstimates पाएं. पार्टनर के बैकएंड की मदद से यह पुष्टि की जाती है कि अनुरोध किए गए इंतज़ार के अनुमान उपलब्ध हैं या नहीं. साथ ही, जवाब में इंतज़ार के साथ-साथ वेटलिस्ट का स्टेटस भी दिया जाता है.
अनुरोध
BatchGetWaitEstimatesRequest
रिटर्न वैल्यू
BatchGetWaitEstimatesResponse
// Batch request for the wait estimates for the specified merchant, service and
// party sizes.
message BatchGetWaitEstimatesRequest {
// Required. Partner-provided ID for the merchant.
string merchant_id = 1;
// Required. Partner-provided ID for the service.
string service_id = 2;
// Required. The different party sizes WaitEstimates are requested for.
// WaitEstimates may differ with the number of people in the party. A single
// request will not include duplicate party sizes.
repeated int32 party_size = 3;
}
// Response for the BatchGetWaitEstimates RPC with the wait estimates of the
// specified merchant, service and party sizes.
message BatchGetWaitEstimatesResponse {
// Required. A status for the waitlist that indicates whether new users can
// join and what the reason is if they can’t join. If the waitlist is not
// open, all other fields in the BatchGetWaitEstimatesResponse are expected to
// be unset.
WaitlistStatus waitlist_status = 1;
// The wait estimates for each party size requested. The response should
// contain exactly one wait estimate for each party size sent in the request.
// If a party size is not available for some reason, prefer ommitting it
// instead of returning an error so that the user will have some options to
// choose from.
repeated WaitEstimate wait_estimate = 2;
}
// A status for the waitlist that determines if new users can join and what
// the reason is if they can’t join.
enum WaitlistStatus {
WAITLIST_STATUS_UNSPECIFIED = 0;
// The waitlist is open and is accepting new users.
OPEN = 1;
// There is currently no wait and users should arrive at the merchant
// without joining the waitlist.
CLOSED_NO_WAIT = 2;
// The waitlist is not currently accepting new users because it is full
// or closed for other reasons.
CLOSED_OTHER = 3;
}
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 } }
]
}
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eBatchGetWaitEstimates\u003c/code\u003e retrieves wait estimates for a specified merchant, service, and party sizes, informing users about the waitlist status and estimated wait times.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires \u003ccode\u003emerchant_id\u003c/code\u003e, \u003ccode\u003eservice_id\u003c/code\u003e, and a list of \u003ccode\u003eparty_size\u003c/code\u003e values to obtain wait estimates for different group sizes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBatchGetWaitEstimatesResponse\u003c/code\u003e includes the current \u003ccode\u003ewaitlist_status\u003c/code\u003e (OPEN, CLOSED_NO_WAIT, or CLOSED_OTHER) and a list of \u003ccode\u003ewait_estimate\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003ewait_estimate\u003c/code\u003e object contains the \u003ccode\u003eparty_size\u003c/code\u003e and \u003ccode\u003ewait_length\u003c/code\u003e, which can indicate either no wait or the number of parties ahead in line.\u003c/p\u003e\n"],["\u003cp\u003eThe response may only include wait estimates for available party sizes, omitting unavailable options to offer users alternative choices.\u003c/p\u003e\n"]]],["Partners use the `BatchGetWaitEstimatesRequest` to get wait estimates for a specific merchant, service, and multiple party sizes. The partner backend responds with `BatchGetWaitEstimatesResponse`, including the `WaitlistStatus` (open, closed with no wait, or closed otherwise) and `WaitEstimate` for each requested party size. If a party size is unavailable, it should be omitted. An example shows a request for party sizes 2-10, where sizes 8-10 are unavailable and size 2 has no wait.\n"],null,["# BatchGetWaitEstimates method\n\nGet the\n[WaitEstimates](/actions-center/verticals/reservations/waitlists/reference/booking-server-api-rest/e2e-definition/waitestimate-definition) for a requested merchant, service and party size. The\npartner backend verifies that the requested wait estimates are available and\nprovides the waitlist status along with the waits in the response.\n\n**Request**\n\nBatchGetWaitEstimatesRequest\n\n**Return value**\n\nBatchGetWaitEstimatesResponse \n\n```gdscript\n// Batch request for the wait estimates for the specified merchant, service and\n// party sizes.\nmessage BatchGetWaitEstimatesRequest {\n // Required. Partner-provided ID for the merchant.\n string merchant_id = 1;\n\n // Required. Partner-provided ID for the service.\n string service_id = 2;\n\n // Required. The different party sizes WaitEstimates are requested for.\n // WaitEstimates may differ with the number of people in the party. A single\n // request will not include duplicate party sizes.\n repeated int32 party_size = 3;\n}\n\n// Response for the BatchGetWaitEstimates RPC with the wait estimates of the\n// specified merchant, service and party sizes.\nmessage BatchGetWaitEstimatesResponse {\n // Required. A status for the waitlist that indicates whether new users can\n // join and what the reason is if they can't join. If the waitlist is not\n // open, all other fields in the BatchGetWaitEstimatesResponse are expected to\n // be unset.\n WaitlistStatus waitlist_status = 1;\n\n // The wait estimates for each party size requested. The response should\n // contain exactly one wait estimate for each party size sent in the request.\n // If a party size is not available for some reason, prefer ommitting it\n // instead of returning an error so that the user will have some options to\n // choose from.\n repeated WaitEstimate wait_estimate = 2;\n}\n\n// A status for the waitlist that determines if new users can join and what\n// the reason is if they can't join.\nenum WaitlistStatus {\n WAITLIST_STATUS_UNSPECIFIED = 0;\n\n // The waitlist is open and is accepting new users.\n OPEN = 1;\n\n // There is currently no wait and users should arrive at the merchant\n // without joining the waitlist.\n CLOSED_NO_WAIT = 2;\n\n // The waitlist is not currently accepting new users because it is full\n // or closed for other reasons.\n CLOSED_OTHER = 3;\n}\n```\n\nBatchGetWaitEstimates samples\n-----------------------------\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```"]]