Metoda CreateBooking
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Wyślij prośbę
CreateBookingRequest
Zwracana wartość
CreateBookingResponse
Efekty uboczne
Funkcja CreateBooking zużywa leasing, co powoduje, że nie można go wykorzystać do dalszych rezerwacji.
Kanoniczne kody błędów gRPC
INVALID_ARGUMENT
jeśli podane informacje o kliencie są nieprawidłowe, np. z powodu braku pól;
NOT_FOUND
jeśli podany identyfikator umowy leasingowej jest nieprawidłowy.
RESOURCE_EXHAUSTED
(jeśli od utworzenia rezerwacji przedział stał się niedostępny, np. z powodu kolizji rezerwacji)
ALREADY_EXISTS
(jeśli klient ma już rezerwację na ten czas)
// Request to create a [ext.maps.booking.partner.v0.Booking] for an inventory
// slot. Consumes the lease.
message CreateBookingRequest {
// The lease that is being confirmed to make this booking
LeaseReference lease_ref = 1;
// Personal information of the client making the appointment
ClientInformation client_information = 2;
// Information about payments. If the booking request does not succeed,
// payment authorizations are automatically canceled.
PaymentInformation payment_information = 3;
// The parameters to be used if the payment is processed by the partner
// (i.e. payment_information.payment_processed_by is equal to
// PROCESSED_BY_PARTNER).
PaymentProcessingParameters payment_processing_parameters = 4;
}
// Response with the created [ext.maps.booking.partner.v0.Booking] for an
// inventory slot
message CreateBookingResponse {
// The created booking
Booking booking = 1;
// The updated user payment option used in this booking.
// If a new payment option was purchased to pay for the booking, this should
// be a newly created user payment option.
// If an already purchased user payment option was used for this booking,
// this should reflect an updated version of that user payment option.
UserPaymentOption user_payment_option = 2;
}
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCreateBooking\u003c/code\u003e API creates a booking for an inventory slot using a provided lease, client, payment, and payment processing information.\u003c/p\u003e\n"],["\u003cp\u003eIf successful, it returns the created booking and potentially updated user payment information, consuming the initial lease.\u003c/p\u003e\n"],["\u003cp\u003ePotential errors include invalid client data, invalid lease ID, slot unavailability due to conflict or if the client already has a booking for the given slot.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCreateBookingRequest\u003c/code\u003e contains lease, client, payment, and processing details, while \u003ccode\u003eCreateBookingResponse\u003c/code\u003e returns the booking and user payment information.\u003c/p\u003e\n"]]],["The `CreateBookingRequest` message initiates a booking, consuming a lease and requiring `LeaseReference`, `ClientInformation`, and `PaymentInformation`. A successful request returns a `CreateBookingResponse` containing the `Booking` details and potentially an updated `UserPaymentOption`. Side effects include lease invalidation. Errors include `INVALID_ARGUMENT` (invalid client info), `NOT_FOUND` (invalid lease), `RESOURCE_EXHAUSTED` (slot unavailable), and `ALREADY_EXISTS` (existing booking). The request also includes optional `PaymentProcessingParameters` for partner-processed payments.\n"],null,["# CreateBooking method\n\n**Request**\n\nCreateBookingRequest\n\n**Return value**\n\nCreateBookingResponse\n\n**Side effects**\n\nCreateBooking consumes a Lease, rendering it invalid for any further bookings.\n\n**Canonical gRPC error codes**\n\n- `INVALID_ARGUMENT` if the provided ClientInformation is invalid, e.g. due to missing fields\n- `NOT_FOUND` if the provided lease ID is not valid.\n- `RESOURCE_EXHAUSTED` (if the slot has become unavailable since creating the lease, e.g. due to a conflicting booking)\n- `ALREADY_EXISTS` (if the client already has a booking for the slot)\n\n```scilab\n// Request to create a [ext.maps.booking.partner.v0.Booking] for an inventory\n// slot. Consumes the lease.\nmessage CreateBookingRequest {\n // The lease that is being confirmed to make this booking\n LeaseReference lease_ref = 1;\n\n // Personal information of the client making the appointment\n ClientInformation client_information = 2;\n\n // Information about payments. If the booking request does not succeed,\n // payment authorizations are automatically canceled.\n PaymentInformation payment_information = 3;\n\n // The parameters to be used if the payment is processed by the partner\n // (i.e. payment_information.payment_processed_by is equal to\n // PROCESSED_BY_PARTNER).\n PaymentProcessingParameters payment_processing_parameters = 4;\n}\n\n// Response with the created [ext.maps.booking.partner.v0.Booking] for an\n// inventory slot\nmessage CreateBookingResponse {\n // The created booking\n Booking booking = 1;\n\n // The updated user payment option used in this booking.\n // If a new payment option was purchased to pay for the booking, this should\n // be a newly created user payment option.\n // If an already purchased user payment option was used for this booking,\n // this should reflect an updated version of that user payment option.\n UserPaymentOption user_payment_option = 2;\n}\n```"]]