Contents

handle(bookRestaurantReservation:completion:)

Handles completing the user’s reservation.

Declaration

func handle(bookRestaurantReservation intent: INBookRestaurantReservationIntent, completion: @escaping  @Sendable (INBookRestaurantReservationIntentResponse) -> Void)
func handle(bookRestaurantReservation intent: INBookRestaurantReservationIntent) async -> INBookRestaurantReservationIntentResponse

Parameters

  • intent:

    The intent object containing details about the request. The information in this object has already been resolved and confirmed.

  • completion:

    The handler block to execute with your response. You must execute this handler at some point during your implementation of this method. This handler has no return value and takes the following parameter:

    response

    The Inbookrestaurantreservationintentresponse object you create to report the status of the request. This parameter must not be nil.

Discussion

Your implementation of this method must save the reservation details to your system and communicate the information to the selected restaurant. Your response object should contain a INRestaurantReservationUserBooking object that reflects the status of creating the reservation, including whether the restaurant has received and confirmed the reservation details. When done, execute the provided block with your response object.