Phương thức CheckAvailability

Kiểm tra tình trạng còn phòng cho một vùng được yêu cầu là bước đầu tiên khi tạo một lượt đặt phòng trực tiếp từ một Vùng quảng cáo. Phần phụ trợ của đối tác sẽ xác minh rằng khung giờ nhận đặt hẹn được yêu cầu là hợp lệ và có thể sử dụng. Tiếp đó, ứng dụng yêu cầu tạo một lượt đặt trước cho khu vực này sau khi nhận được thông tin về tình trạng phòng.

Yêu cầu

CheckAvailabilityRequest

Giá trị trả về

CheckAvailabilityResponse (Phản hồi kiểm tra tính sẵn có)

Mã lỗi gRPC chính tắc

  • INVALID_ARGUMENT (mã người bán, mã dịch vụ hoặc thông số thời gian không hợp lệ)
// Request to check availability for a [ext.maps.booking.partner.v2.Slot]
message CheckAvailabilityRequest {
  // The appointment slot that is being checked (required)
  Slot slot = 1;
}

// Response for the [ext.maps.booking.partner.v2.CheckAvailability] RPC with the
// availability of the appointment slot
message CheckAvailabilityResponse {
  // The requested slot. (required)
  Slot slot = 1;
  // Number of available spots.
  // 0 indicates that the appointment slot is not available. (required)
  int32 count_available = 2;

  // If set, the last time (in seconds since the Unix epoch) that this specific
  // appointment slot can be cancelled through Reserve with Google. This field
  // will override any service-level cancellation rules. (optional)
  //
  // Deprecated: Use scheduling_rule_overrides.last_online_cancellable_sec
  // in the Availability feed instead.
  int64 last_online_cancellable_sec = 5 [deprecated = true];

  // This enum indicates what requirements exist for the user to acknowledge or
  // view the requested slots duration/end time.
  enum DurationRequirement {
    // The handling of the end time is not specified. This is the default.
    DURATION_REQUIREMENT_UNSPECIFIED = 0;

    // The end time is not shown to the user.
    DO_NOT_SHOW_DURATION = 1;

    // The end time has to be shown to the user before an appointment can be
    // made.
    MUST_SHOW_DURATION = 2;
  }
  // The requirement to show the slots duration and/or endtime. This field will
  // be ignored if the slot is unavailable. (optional)
  //
  // Deprecated: Use duration_requirement in the Availability feed instead.
  DurationRequirement duration_requirement = 3 [deprecated = true];

  // Optionally, the partner can return additional updated information about the
  // availability for this merchant if this information is present when
  // responding to the CheckAvailabilityRequest and if there is no negative
  // impact on the CheckAvailability request latency.
  // For instance an entire day of merchant availability for a superset of
  // resources can be returned here.
  AvailabilityUpdate availability_update = 4;
}