Метод 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;
}
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-01-04 UTC.
[null,null,["Последнее обновление: 2025-01-04 UTC."],[[["Partners must create and set `lease_id` and `lease_expiration_time` in the `CreateLeaseResponse`."],["`CreateLeaseResponse` must mirror the `CreateLeaseRequest`, including the `resources` field if provided, and all other fields."],["Potential errors include `INVALID_ARGUMENT`, `ALREADY_EXISTS`, and `RESOURCE_EXHAUSTED` for various invalid input or booking conflicts."],["The `CreateLeaseRequest` initiates a lease creation for a specific appointment slot, while the `CreateLeaseResponse` returns the created lease details."],["The backend may adjust the lease expiration time in the response."]]],["The `CreateLeaseRequest` initiates a lease creation, and `CreateLeaseResponse` returns the created lease. The partner backend must generate the `lease_id` and `lease_expiration_time` in the response. If `resources` is in the request, it must be mirrored in the response. All other response fields should mirror the request. Potential gRPC errors include `INVALID_ARGUMENT`, `ALREADY_EXISTS` if a lease exists, or `RESOURCE_EXHAUSTED` if the slot is unavailable. The response might adjust the expiration time.\n"]]