เมธอด CreateLease

การรองรับการสร้างสัญญาเช่าเป็นทางเลือก โดยมีผลกับพาร์ทเนอร์ที่ สนใจใช้ฟังก์ชันการทำงานนี้ โปรดติดต่อศูนย์การดำเนินการเพื่อตรวจสอบการมีสิทธิ์ก่อนเริ่ม

การสร้างสัญญาเช่าเป็นขั้นตอนแรกเมื่อสร้างการจองด้วยการสนับสนุนสัญญาเช่า แบ็กเอนด์ของพาร์ทเนอร์จะยืนยันว่าช่วงเวลาที่ขอถูกต้องและพร้อมให้บริการ ภายใน พาร์ทเนอร์จะสร้างการระงับชั่วคราวสำหรับ สล็อตที่ขอ ซึ่งตั้งค่าให้หมดอายุโดยอัตโนมัติที่ lease_expiration_time แบ็กเอนด์ได้รับอนุญาตให้แก้ไข lease_expiration_time เช่น หากเวลาเช่าที่ขอ นานเกินไป ระบบจะส่งคืนสัญญาเช่าที่สร้างขึ้นไปยังไคลเอ็นต์ จากนั้นไคลเอ็นต์จะขอสร้างการจองสำหรับสัญญาเช่า

หากการสร้างสัญญาเช่าล้มเหลวเนื่องจากข้อผิดพลาดทางตรรกะทางธุรกิจ ข้อผิดพลาดควร แสดงในการตอบกลับ ดูข้อมูลโดยละเอียดได้ที่การจอง ล้มเหลว

คำขอ

CreateLeaseRequest

ค่าที่ส่งคืน

CreateLeaseResponse

ข้อกำหนด

  • พาร์ทเนอร์ต้องสร้าง 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 {
  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;
}