طريقة CreateLease

إنّ إمكانية إنشاء عنوان إيجار اختياري. وتنطبق هذه السياسة على الشركاء المهتمين بتنفيذ هذه الوظيفة. يُرجى التواصل مع "مركز الإجراءات" لتحديد الأهلية قبل البدء.

يكون إنشاء عقد الإيجار الخطوة الأولى عند إنشاء حجز من خلال فريق دعم الإيجار. تتحقّق الواجهة الخلفية للشريك من أنّ خانة المواعيد المطلوبة صالحة ومتاحة. داخليًا، ينشئ الشريك حجزًا مؤقتًا للخانة الإعلانية المطلوبة، والذي تم إعداده لتنتهي صلاحيته تلقائيًا في lease_expiration_time. يُسمح للخلفية بتعديل lease_expiration_time، مثلاً إذا كان وقت الاستئجار المطلوب طويل جدًا. يتم إرجاع عقد الإيجار الذي تم إنشاؤه إلى العميل. بعد ذلك، يطلب العميل إنشاء حجز للإيجار.

إذا فشل إنشاء عقد إيجار بسبب أي خطأ في منطق العمل، يجب تعبئة الخطأ في الاستجابة. راجِع تعذُّر الحجز للحصول على معلومات مفصّلة.

طلب

إنشاء طلب ترخيص

القيمة المعروضة

إنشاء ردّ ترخيص

المتطلبات:

  • يجب إنشاء lease_id بواسطة الواجهة الخلفية للشريك وضبطها في CreateLeaseResponse.
  • يجب ضبط lease_expiration_time في CreateLeaseResponse.
  • إذا تم تحديد حقل الموارد في 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;
}