CreateLease 方法

请求

CreateLeaseRequest

返回值

CreateLeaseResponse

要求:

  • lease_id 必须由合作伙伴后端创建,并在 CreateLeaseResponse 中设置。
  • 必须在 CreateLeaseResponse 中设置 lease_expiration_time。
  • 如果在 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;
}