UpdateBooking 메서드

클라이언트가 UpdateBooking을 사용하여 기존 예약을 수정하거나 취소합니다.

비즈니스 로직 오류로 인해 예약을 업데이트하지 못하면 응답에 오류가 채워집니다. 자세한 내용은 예약 실패를 참고하세요.

요청

UpdateBookingRequest

요청 메시지에는 예약 필드에 업데이트된 정보가 포함되며, update_mask 필드에 업데이트될 모든 예약 필드의 경로가 나타납니다. 예를 들어 기존 예약의 일정을 변경하는 요청의 update_mask 필드에는 다음 두 경로가 포함됩니다.

  paths: "slot.start_time"
  paths: "slot.duration"

자세한 내용은 FieldMask를 참고하세요.

반환값

UpdateBookingResponse

표준 gRPC 오류 코드

  • INVALID_ARGUMENT: 제공된 필드 마스크에 잘못된 값이 포함되어 있거나 업데이트된 예약 필드가 잘못된 경우.
  • NOT_FOUND(제공된 예약 ID를 파트너가 알 수 없는 경우)
// Request to update a [ext.maps.booking.partner.v2.Booking]
message UpdateBookingRequest {
  // Field mask of all booking fields to be updated (optional)
  google.protobuf.FieldMask update_mask = 1;

  // The booking to be updated
  // The following fields can be set in a booking:
  // - status, to cancel a booking.
  // - one of the following is required:
  //   - start_time AND duration in the slot, to reschedule a booking.
  //   - party_size (for dining reservations).
  Booking booking = 2;
}

// Response with the updated [ext.maps.booking.partner.v2.Booking]
message UpdateBookingResponse {
  // The updated booking (required)
  Booking booking = 1;

  // The updated user payment option originally used to pay for this booking.
  // This should be set if the UpdateBookingRequest results in a change to
  // the UserPaymentOption.
  // For instance, if the booking is canceled, the UserPaymentOption should
  // reflect an additional credit to the user. In the case of a multi-use
  // payment option, the current_count should be increased by one to
  // allow the user to create another booking with this payment option. In the
  // case of a single-use payment option, a new single-use user payment option
  // should be returned. (required if altered in update)
  UserPaymentOption user_payment_option = 2;

  // If updating a booking fails, this field should reflect the business logic
  // error (e.g., booking is not cancellable) (required if failure occurs)
  BookingFailure booking_failure = 3;
}