class Nylas::Bookings

Nylas Messages API

Public Instance Methods

confirm_booking(booking_id:, request_body:, query_params:) click to toggle source

Confirm a booking. @param booking_id [String] The id of the booking to confirm. @param request_body [Hash] The values to update the booking with @param query_params [Hash, nil] Query params to pass to the request. @return [Array(Hash, String)] The updated booking and API Request ID.

# File lib/nylas/resources/bookings.rb, line 56
def confirm_booking(booking_id:, request_body:, query_params:)
  put(
    path: "#{api_uri}/v3/scheduling/bookings/#{booking_id}",
    request_body: request_body,
    query_params: query_params
  )
end
create(request_body:, query_params:) click to toggle source

Create a booking. @param request_body [Hash] The values to create the booking with. @param query_params [Hash, nil] Query params to pass to the request. @return [Array(Hash, String)] The created booking and API Request ID.

# File lib/nylas/resources/bookings.rb, line 30
def create(request_body:, query_params:)
  post(
    path: "#{api_uri}/v3/scheduling/bookings",
    request_body: request_body,
    query_params: query_params
  )
end
destroy(booking_id:, query_params:) click to toggle source

Delete a booking. @param booking_id [String] The id of the booking to delete. @param query_params [Hash, nil] Query params to pass to the request. @return [Array(TrueClass, String)] True and the API Request ID for the delete operation.

# File lib/nylas/resources/bookings.rb, line 68
def destroy(booking_id:, query_params:)
  _, request_id = delete(
    path: "#{api_uri}/v3/scheduling/bookings/#{booking_id}",
    query_params: query_params
  )

  [true, request_id]
end
find(booking_id:, query_params:) click to toggle source

Return a booking. @param booking_id [String] The id of the booking to return. @param query_params [Hash, nil] Query params to pass to the request. @return [Array(Hash, String)] The booking and API request ID.

# File lib/nylas/resources/bookings.rb, line 19
def find(booking_id:, query_params:)
  get(
    path: "#{api_uri}/v3/scheduling/bookings/#{booking_id}",
    query_params: query_params
  )
end
update(request_body:, booking_id:, query_params:) click to toggle source

Create a booking. @param request_body [Hash] The values to update the booking with. @param booking_id [String] The id of the booking to update. @param query_params [Hash, nil] Query params to pass to the request. @return [Array(Hash, String)] The created booking and API Request ID.

# File lib/nylas/resources/bookings.rb, line 43
def update(request_body:, booking_id:, query_params:)
  patch(
    path: "#{api_uri}/v3/scheduling/bookings/#{booking_id}",
    request_body: request_body,
    query_params: query_params
  )
end