चैप्टर-वेट अनुमान का तरीका

किसी व्यापारी/कंपनी/कारोबारी, सेवा, और पार्टी में शामिल लोगों की संख्या के बारे में जानने के लिए, 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;
}

BatchGetGetStats के नमूने

इस उदाहरण में एक ऐसे मामले को दिखाया गया है जहां आम तौर पर कोई रेस्टोरेंट, 2 से 10 तक party_size की वैल्यू देने की अनुमति देता है. हालांकि, अनुरोध करते समय, 7 से ज़्यादा वैल्यू वाले party_size को शामिल नहीं किया जा सकता. उदाहरण के लिए, बंद होने के समय के आस-पास और दो में से party_size वैल्यू को कोई इंतज़ार नहीं करना पड़ता.

इंतज़ार का अनुरोध करें

{
  "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 } }
  ]
}