إنّ إتاحة إنشاء عقد إيجار هو اختياري. وينطبق ذلك على الشركاء المهتمين بتنفيذ هذه الوظيفة. يُرجى التواصل مع فريق "مركز الإجراءات" لتحديد الأهلية قبل البدء.
يُعدّ إنشاء عقد الإيجار الخطوة الأولى عند إنشاء حجز يتضمّن ميزة "عقد الإيجار". تتحقّق الخلفية من الشريك من أنّ خانة الموعد المطلوبة صالحة ومتوفرة. داخليًا، ينشئ الشريك حجزًا مؤقتًا للمساحة المطلوبة، ويتم إعداده لتنتهي صلاحيته تلقائيًا في وقت انتهاء_مدة_الإيجار. يُسمح للخدمة الخلفية بتعديل lease_expiration_time، مثلاً إذا كان وقت التربّع المطلوب طويلًا جدًا. يتم إرجاع عقد الإيجار الذي تم إنشاؤه إلى العميل. بعد ذلك، يطلب العميل إنشاء حجز للملكية.
إذا تعذّر إنشاء عقد إيجار بسبب أي خطأ في منطق النشاط التجاري، يجب ملء الخطأ في الاستجابة. اطّلِع على تعذُّر الحجز للحصول على معلومات تفصيلية.
الطلب
CreateLeaseRequest
القيمة المعروضة
CreateLeaseResponse
المتطلبات:
- يجب أن ينشئ شريكك في الخلفية مَعلمة lease_id ويضبطها في ملف CreateLeaseResponse.
- يجب ضبط lease_expiration_time في CreateLeaseResponse.
- إذا تم تحديد حقل resources في CreateLeaseRequest، يجب ضبطه في CreateLeaseResponse، ومطابقة CreateLeaseRequest.
- يجب ضبط جميع الحقول الأخرى في CreateLeaseResponse ومطابقتها مع CreateLeaseRequest.
رموز خطأ gRPC الأساسية
INVALID_ARGUMENT
(معرّف التاجر أو معرّف الخدمة أو وقت المساحة الإعلانية غير صالح)
// Request to create a [ext.maps.booking.partner.v2.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 // (required) Lease lease = 1; } // Response for the [ext.maps.booking.partner.v2.CreateLease] RPC with the // created [ext.maps.booking.partner.v2.Lease] message CreateLeaseResponse { // The created [ext.maps.booking.partner.v2.Lease] (required) Lease lease = 1; // If creating a lease fails, this field should reflect the business logic // error (e.g., slot has become unavailable) and lease field is expected to be // unset. (required if failure occurs) BookingFailure booking_failure = 2; }