השיטה CreateLease

התמיכה ביצירת זיכיון היא אופציונלית. היא רלוונטית לשותפים שרוצים להטמיע את הפונקציונליות הזו. לפני שמתחילים, צריך לפנות למרכז הפעולות כדי לבדוק את הזכאות.

יצירת החכירה היא השלב הראשון ביצירת הזמנה עם תמיכה בחכירה. הקצה העורפי של השותף בודק שהמועד המבוקש לפגישה תקף וזמין. באופן פנימי, השותף יוצר השהייה זמנית של המשבצת המבוקשת, שתוקפה יפוג באופן אוטומטי ב-lease_expiration_time. לקצה העורפי מותר לשנות את 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;
}