CreateLease メソッド
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
リクエスト
CreateLeaseRequest
戻り値
CreateLeaseResponse
要件:
- lease_id はパートナーのバックエンドで作成し、CreateLeaseResponse で設定する必要があります。
- lease_expiration_time は CreateLeaseResponse で設定する必要があります。
- リソース フィールドが CreateLeaseRequest で指定されている場合は、CreateLeaseResponse で設定し、CreateLeaseRequest と一致させる必要があります。
- CreateLeaseResponse のその他すべてのフィールドを設定し、CreateLeaseRequest と一致させる必要があります。
正規 gRPC エラーコード
INVALID_ARGUMENT
(無効な販売者 ID、サービス ID、顧客のリファレンス、スロットの時間の指定)
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;
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 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```"]]