Метод CreateLease

Запрос

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

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

CreateLeaseResponse

Требования:

  • Параметр lease_id должен быть создан в бэкэнде партнера и указан в объекте CreateLeaseResponse.
  • Параметр lease_expiration_time необходимо задать в методе CreateLeaseResponse.
  • Если поле resources указано в запросе CreateLeaseRequest, то оно должно быть установлено в ответе CreateLeaseResponse и соответствовать полю CreateLeaseRequest.
  • Все остальные поля в CreateLeaseResponse должны быть заданы и соответствовать полю CreateLeaseRequest.

Коды ошибок Canonical 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 {
  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;
}