Метод CreateLease

Запрос

Создать запрос на аренду

Возвращаемое значение

CreateLeaseResponse

Требования:

  • Lease_id должен быть создан серверной частью партнера и установлен в CreateLeaseResponse.
  • Lease_expiration_time должно быть установлено в CreateLeaseResponse.
  • Если поле ресурсов указано в CreateLeaseRequest, оно должно быть установлено в CreateLeaseResponse и соответствовать CreateLeaseRequest.
  • Все остальные поля в CreateLeaseResponse должны быть установлены и соответствовать CreateLeaseRequest.

Канонические коды ошибок gRPC

  • INVALID_ARGUMENT (неверный идентификатор продавца, идентификатор услуги, номер клиента или указание времени интервала)
  • 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;
}