WaitEstimate 定义

WaitEstimate 包含有关特定商家和人数的当前等待时间的信息。

// The range of time for the current estimated seat time for the user. Estimated
// seat time range must change over time when the merchant or partner updates
// their estimates.
message EstimatedSeatTimeRange {
  // Required. The lower bound for the range. Expressed as the number of seconds
  // since the Unix epoch.
  int64 start_seconds = 1;

  // Required. The upper bound for the range. Expressed as the number of seconds
  // since the Unix epoch.
  int64 end_seconds = 2;
}

// Contains fields measuring how long (in time or # of people) until the
// user is ready to leave the waitlist and be seated.
message WaitLength {
  // The count of how many other parties are ahead of the user in the waitlist.
  // parties_ahead_count must change over time as parties ahead
  // in the waitlist are seated or leave the waitlist. Either
  // parties_ahead_count or estimated_seat_time_range must be populated. Both
  // should be populated.
  int32 parties_ahead_count = 1;

  // The range of time that the user is estimated to be seated in. Either
  // parties_ahead_count or estimated_seat_time_range must be populated. Both
  // should be populated.
  EstimatedSeatTimeRange estimated_seat_time_range = 2;
}

// The confirmation modes used when joining the waitlist.
enum WaitlistConfirmationMode {
  // The confirmation mode was not specified.
  // Synchronous confirmation will be assumed.
  WAITLIST_CONFIRMATION_MODE_UNSPECIFIED = 0;

  // Waitlist entries will be confirmed synchronously.
  WAITLIST_CONFIRMATION_MODE_SYNCHRONOUS = 1;

  // Waitlist entries will be confirmed asynchronously.
  WAITLIST_CONFIRMATION_MODE_ASYNCHRONOUS = 2;
}

// The wait estimate for a particular party size, merchant and service.
message WaitEstimate {
  // Required. The party size this wait estimate applies to.
  int32 party_size = 1;

  // Required. Contains fields measuring how long (in time or # of people) until
  // the user is ready to leave the waitlist and be seated.
  WaitLength wait_length = 2;

  // Required. Indicates whether waitlist entries for this wait estimate will be
  // confirmed synchronously or asynchronously. An UNSPECIFIED value will be
  // interpreted as synchronous.
  WaitlistConfirmationMode waitlist_confirmation_mode = 3;
}