Phương thức CreateLease

Yêu cầu

CreateLeaseRequest

Giá trị trả về

CreateLeaseResponse

Yêu cầu:

  • đối tác phụ trợ phải tạo lease_id và đặt trong CreateLeaseResponse.
  • Bạn phải đặt lease_expiration_time trong CreateLeaseResponse.
  • Nếu trường tài nguyên được chỉ định trong CreateLeaseRequest, thì trường này phải được đặt trong CreateLeaseResponse và khớp với CreateLeaseRequest.
  • Bạn phải đặt tất cả các trường khác trong CreateLeaseResponse và khớp với CreateLeaseRequest.

Mã lỗi gRPC chuẩn

  • INVALID_ARGUMENT (mã người bán, mã dịch vụ, thông tin tham chiếu của khách hàng hoặc quy cách thời gian đặt chỗ không hợp lệ)
  • ALREADY_EXISTS (nếu khách hàng đã thuê vị trí này)
  • RESOURCE_EXHAUSTED (nếu khung giờ không còn trống)
// Request to create a [ext.maps.booking.partner.v0.Lease] for a slot in the
// inventory.  The expiration time in the returned Lease may be modified by the
// backend, e.g. if the requested lease period is too long.
message CreateLeaseRequest {
  option features.(pb.java).nest_in_file_class = YES;

  // The lease to be created with information about the appointment slot
  Lease lease = 1;
}

// Response for the [ext.maps.booking.partner.v0.CreateLease] RPC with the
// created [ext.maps.booking.partner.v0.Lease]
message CreateLeaseResponse {
  option features.(pb.java).nest_in_file_class = YES;

  // The created [ext.maps.booking.partner.v0.Lease]
  Lease lease = 1;
}