Metodo CreateLease

Richiesta

CreateLeaseRequest

Valore restituito

CreateLeaseResponse

Requisiti:

  • lease_id deve essere creato dal backend del partner e impostato in CreateLeaseResponse.
  • lease_expiration_time deve essere impostato in CreateLeaseResponse.
  • Se il campo delle risorse è specificato in CreateLeaseRequest, deve essere impostato in CreateLeaseResponse e corrispondere a CreateLeaseRequest.
  • Tutti gli altri campi di CreateLeaseResponse devono essere impostati e corrispondere a CreateLeaseRequest.

Codici di errore gRPC canonici

  • INVALID_ARGUMENT (ID commerciante, ID servizio, riferimento client o specifica dell'ora dello slot non validi)
  • ALREADY_EXISTS (se il cliente ha già un contratto di locazione per lo slot)
  • RESOURCE_EXHAUSTED (se lo spazio non è disponibile)
// 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;
}