CreateLease yöntemi
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
İstek
CreateLeaseRequest
Döndürülen değer
CreateLeaseResponse
Koşullar:
- lease_id, iş ortağı arka uç tarafından oluşturulmalı ve CreateLeaseResponse'ta ayarlanmalıdır.
- CreateLeaseResponse'ta lease_expiration_time ayarlanmalıdır.
- resources alanı CreateLeaseRequest'te belirtilmişse CreateLeaseResponse'te ayarlanmalı ve CreateLeaseRequest ile eşleşmelidir.
- CreateLeaseResponse'teki diğer tüm alanlar ayarlanmalı ve CreateLeaseRequest ile eşleşmelidir.
Standart gRPC hata kodları
INVALID_ARGUMENT
(geçersiz satıcı kimliği, hizmet kimliği, istemci referansı veya aralık zamanı spesifikasyonu)
ALREADY_EXISTS
(müşterinin yuvada zaten kira sözleşmesi varsa)
RESOURCE_EXHAUSTED
(slot kullanılamıyorsa)
// 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;
}
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003ePartners must create and set \u003ccode\u003elease_id\u003c/code\u003e and \u003ccode\u003elease_expiration_time\u003c/code\u003e in the \u003ccode\u003eCreateLeaseResponse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCreateLeaseResponse\u003c/code\u003e must mirror the \u003ccode\u003eCreateLeaseRequest\u003c/code\u003e, including the \u003ccode\u003eresources\u003c/code\u003e field if provided, and all other fields.\u003c/p\u003e\n"],["\u003cp\u003ePotential errors include \u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e, \u003ccode\u003eALREADY_EXISTS\u003c/code\u003e, and \u003ccode\u003eRESOURCE_EXHAUSTED\u003c/code\u003e for various invalid input or booking conflicts.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateLeaseRequest\u003c/code\u003e initiates a lease creation for a specific appointment slot, while the \u003ccode\u003eCreateLeaseResponse\u003c/code\u003e returns the created lease details.\u003c/p\u003e\n"],["\u003cp\u003eThe backend may adjust the lease expiration time in the response.\u003c/p\u003e\n"]]],["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"],null,["# CreateLease method\n\n**Request**\n\nCreateLeaseRequest\n\n**Return value**\n\nCreateLeaseResponse\n\nRequirements:\n\n- lease_id must be created by the partner backend and set in the CreateLeaseResponse.\n- lease_expiration_time must be set in the CreateLeaseResponse.\n- If the resources field is specified in the CreateLeaseRequest, then it must be set in the CreateLeaseResponse, and match the CreateLeaseRequest.\n- All other fields in the CreateLeaseResponse must be set and match the CreateLeaseRequest.\n\n**Canonical gRPC error codes**\n\n- `INVALID_ARGUMENT` (invalid merchant ID, service ID, client reference or slot time specification)\n- `ALREADY_EXISTS` (if the client already has a lease on the slot)\n- `RESOURCE_EXHAUSTED` (if the slot is not available)\n\n```scilab\n// Request to create a [ext.maps.booking.partner.v0.Lease] for a slot in the\n// inventory. The expiration time in the returned Lease may be modified by the\n// backend, e.g. if the requested lease period is too long.\nmessage CreateLeaseRequest {\n // The lease to be created with information about the appointment slot\n Lease lease = 1;\n}\n\n// Response for the [ext.maps.booking.partner.v0.CreateLease] RPC with the\n// created [ext.maps.booking.partner.v0.Lease]\nmessage CreateLeaseResponse {\n // The created [ext.maps.booking.partner.v0.Lease]\n Lease lease = 1;\n}\n```"]]