CreateLease का तरीका

अनुरोध

CreateLeaseRequest

रिटर्न वैल्यू

CreateLeaseResponse

ज़रूरतें:

  • lease_id को पार्टनर के बैकएंड से बनाया जाना चाहिए और इसे CreateLeaseResponse में सेट किया जाना चाहिए.
  • CreateLeaseResponse में lease_expiration_time सेट होना चाहिए.
  • अगर CreateLeaseRequest में resources फ़ील्ड के बारे में बताया गया है, तो इसे 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 {
  option features.(pb.java).nest_in_file_class = YES;

  // 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 {
  option features.(pb.java).nest_in_file_class = YES;

  // The created [ext.maps.booking.partner.v0.Lease]
  Lease lease = 1;
}