CreateLease 方法

要求

CreateLeaseRequest

傳回值

CreateLeaseResponse

相關規定如下:

  • lease_id 必須由合作夥伴後端建立,並在 CreateLeaseResponse 中設定。
  • lease_expiration_time 必須在 CreateLeaseResponse 中設定。
  • 若在 CreateLeaseRequest 中指定了資源欄位,則該欄位必須在 CreateLeaseResponse 中設定,並與 CreateLeaseRequest 相符。
  • 必須設定 CreateLeaseResponse 中的所有其他欄位,而且這些欄位都與 CreateLeaseRequest 相符。

標準 gRPC 錯誤代碼

  • INVALID_ARGUMENT:商家 ID,服務 ID、客戶參考資料或時段的時間規格無效
  • ALREADY_EXISTS:客戶已保留該時段
  • RESOURCE_EXHAUSTED:時段無法接受預訂
// 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 {
  // 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 {
  // The created [ext.maps.booking.partner.v0.Lease]
  Lease lease = 1;
}