Metodo CreateBooking
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Richiedi
CreateBookingRequest
Valore restituito
CreateBookingResponse
Effetti collaterali
CreateBooking utilizza un contratto di locazione, rendendolo non valido per ulteriori prenotazioni.
Codici di errore gRPC canonici
INVALID_ARGUMENT
se i dati del cliente forniti non sono validi, ad esempio a causa di campi mancanti
NOT_FOUND
se l'ID leasing fornito non è valido.
RESOURCE_EXHAUSTED
(se lo spazio non è più disponibile dalla creazione del contratto di locazione, ad esempio a causa di una prenotazione in conflitto)
ALREADY_EXISTS
(se il cliente ha già una prenotazione per l'appuntamento)
// 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;
}
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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```"]]