Metoda CreateLease

Wyślij prośbę

CreateLeaseRequest

Zwracana wartość

CreateLeaseResponse

Wymagania:

  • lease_id musi zostać utworzony przez backend partnera i ustawiony w CreateLeaseResponse.
  • W odpowiedzi na wywołanie CreateLeaseResponse musisz podać wartość lease_expiration_time.
  • Jeśli pole resources jest określone w zapytaniu CreateLeaseRequest, musi być ustawione w odpowiedzi CreateLeaseResponse i musi być zgodne z zapytaniem 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, odniesienie do klienta lub specyfikacja czasu rezerwacji)
  • ALREADY_EXISTS (jeśli klient ma już wykupiony czas na tym slocie)
  • RESOURCE_EXHAUSTED (jeśli slot 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;
}