روش UpdateBooking

درخواست

UpdateBookingRequest

پیام درخواست حاوی اطلاعات به‌روزشده در فیلد رزرو است و مسیرهای همه فیلدهای رزرو را که باید در فیلد update_mask به‌روز شوند فهرست می‌کند. برای مثال، فیلد update_mask در درخواستی که زمان رزرو موجودی را تغییر می‌دهد حاوی دو مسیر زیر است:

  paths: "start_time"
  paths: "duration"

برای اطلاعات بیشتر، به FieldMask مراجعه کنید.

برگرداندن مقدار

UpdateBookingResponse

کدهای خطای Canonical gRPC

  • INVALID_ARGUMENT اگر ماسک فیلد ارائه‌شده حاوی مقادیر نامعتبر باشد یا هرکدام از فیلدهای «رزرو» به‌روزشده نامعتبر باشد. این شامل مواردی می‌شود که به‌روزرسانی فیلد طبق منطق کسب‌وکار مجاز نیست، مثلاً به‌دلیل اینکه برای لغو کردن خیلی دیر شده است.
  • NOT_FOUND اگر شناسه رزرو ارائه‌شده ناشناخته باشد
  • RESOURCE_EXHAUSTED اگر وقت مربوط به زمان شروع به‌روزشده برای رزرو دردسترس نباشد.
// Request to update a [ext.maps.booking.partner.v0.Booking]
export message UpdateBookingRequest {
  option features.(pb.java).nest_in_file_class = YES;

  // Field mask of all booking fields to be updated
  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.
  // - start_time and duration to reschedule a booking.
  Booking booking = 2;
}

// Response with the updated [ext.maps.booking.partner.v0.Booking]
export message UpdateBookingResponse {
  option features.(pb.java).nest_in_file_class = YES;

  // The updated booking
  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.
  UserPaymentOption user_payment_option = 2;
}