Metoda CreateLease

Wyślij prośbę

CreateLeaseRequest

Zwracana wartość

CreateLeaseResponse

Wymagania:

  • Element lease_id musi zostać utworzony przez backend partnera i ustawiony w opcji CreateLeaseResponse.
  • Wartość lease_expiration_time musi być ustawiona w obiekcie CreateLeaseResponse.
  • Jeśli pole zasobów jest określone w CreateLeaseRequest, musi być ustawione w CreateLeaseResponse i zgodne z CreateLeaseRequest.
  • Wszystkie pozostałe pola w CreateLeaseResponse muszą być ustawione i zgodne z CreateLeaseRequest.

Kanoniczne kody błędów gRPC

  • INVALID_ARGUMENT (nieprawidłowy identyfikator sprzedawcy, identyfikator usługi, odwołanie do klienta lub specyfikacja czasu przedziałów)
  • ALREADY_EXISTS (jeśli klient ma już dzierżawę boksu)
  • RESOURCE_EXHAUSTED (jeśli przedział jest niedostępny)
// 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;
}