روش CreateLease
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
درخواست کنید
CreateLeaseRequest
ارزش برگشتی
CreateLeaseResponse
الزامات:
- lease_id باید توسط backend شریک ایجاد شده و در 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 Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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```"]]