लीज़ बनाने की सुविधा ज़रूरी नहीं है. यह उन पार्टनर पर लागू होती है जो इस सुविधा को लागू करने में दिलचस्पी रखते हैं. कृपया शुरू करने से पहले, Actions Center से संपर्क करके ज़रूरी शर्तें पूरी करने के बारे में जानें.
किराये पर देने की सुविधा के साथ बुकिंग बनाने के लिए, सबसे पहले लीज़ बनानी होती है. पार्टनर का बैकएंड यह पुष्टि करता है कि अपॉइंटमेंट का अनुरोध किया गया स्लॉट मान्य है और उपलब्ध है. पार्टनर, अनुरोध की गई स्लॉट के लिए कुछ समय के लिए होल्ड बनाता है. यह होल्ड, lease_expiration_time पर अपने-आप खत्म हो जाता है. बैकएंड को lease_expiration_time में बदलाव करने की अनुमति है. उदाहरण के लिए, अगर लीज़ का अनुरोध किया गया समय बहुत ज़्यादा है. बनाई गई लीज़ को क्लाइंट को वापस भेज दिया जाता है. इसके बाद, क्लाइंट लीज़ के लिए बुकिंग बनाने का अनुरोध करता है.
अगर कारोबार से जुड़ी किसी गड़बड़ी की वजह से लीज़ नहीं बनाई जा सकती है, तो जवाब में गड़बड़ी की जानकारी शामिल होनी चाहिए. ज़्यादा जानकारी के लिए, बुकिंग फ़ेल होना लेख पढ़ें.
अनुरोध
CreateLeaseRequest
रिटर्न वैल्यू
CreateLeaseResponse
ज़रूरतें:
- lease_id को पार्टनर के बैकएंड से बनाया जाना चाहिए और इसे CreateLeaseResponse में सेट किया जाना चाहिए.
- CreateLeaseResponse में lease_expiration_time सेट होना चाहिए.
- अगर CreateLeaseRequest में resources फ़ील्ड के बारे में बताया गया है, तो इसे 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 { option features.(pb.java).nest_in_file_class = YES; // 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 { option features.(pb.java).nest_in_file_class = YES; // 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; }