Skip to content

Latest commit

 

History

History
332 lines (229 loc) · 8.68 KB

File metadata and controls

332 lines (229 loc) · 8.68 KB

Bookings

bookings_api = client.bookings

Class Name

BookingsApi

Methods

Create Booking

Creates a booking.

def create_booking(body:)

Parameters

Parameter Type Tags Description
body Create Booking Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Create Booking Response Hash

Example Usage

body = {}
body[:idempotency_key] = 'idempotency_key2'
body[:booking] = {}
body[:booking][:id] = 'id8'
body[:booking][:version] = 148
body[:booking][:status] = 'ACCEPTED'
body[:booking][:created_at] = 'created_at6'
body[:booking][:updated_at] = 'updated_at4'

result = bookings_api.create_booking(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Search Availability

Searches for availabilities for booking.

def search_availability(body:)

Parameters

Parameter Type Tags Description
body Search Availability Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Search Availability Response Hash

Example Usage

body = {}
body[:query] = {}
body[:query][:filter] = {}
body[:query][:filter][:start_at_range] = {}
body[:query][:filter][:start_at_range][:start_at] = 'start_at8'
body[:query][:filter][:start_at_range][:end_at] = 'end_at4'
body[:query][:filter][:location_id] = 'location_id6'
body[:query][:filter][:segment_filters] = []


body[:query][:filter][:segment_filters][0] = {}
body[:query][:filter][:segment_filters][0][:service_variation_id] = 'service_variation_id8'
body[:query][:filter][:segment_filters][0][:team_member_id_filter] = {}
body[:query][:filter][:segment_filters][0][:team_member_id_filter][:all] = ['all7']
body[:query][:filter][:segment_filters][0][:team_member_id_filter][:any] = ['any0', 'any1']
body[:query][:filter][:segment_filters][0][:team_member_id_filter][:none] = ['none5']

body[:query][:filter][:segment_filters][1] = {}
body[:query][:filter][:segment_filters][1][:service_variation_id] = 'service_variation_id7'
body[:query][:filter][:segment_filters][1][:team_member_id_filter] = {}
body[:query][:filter][:segment_filters][1][:team_member_id_filter][:all] = ['all6', 'all7', 'all8']
body[:query][:filter][:segment_filters][1][:team_member_id_filter][:any] = ['any1', 'any2', 'any3']
body[:query][:filter][:segment_filters][1][:team_member_id_filter][:none] = ['none6', 'none7']

body[:query][:filter][:booking_id] = 'booking_id6'

result = bookings_api.search_availability(body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Retrieve Business Booking Profile

Retrieves a seller's booking profile.

def retrieve_business_booking_profile

Response Type

Retrieve Business Booking Profile Response Hash

Example Usage

result = bookings_api.retrieve_business_booking_profile()

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

List Team Member Booking Profiles

Lists booking profiles for team members.

def list_team_member_booking_profiles(bookable_only: false,
                                      limit: nil,
                                      cursor: nil,
                                      location_id: nil)

Parameters

Parameter Type Tags Description
bookable_only Boolean Query, Optional Indicates whether to include only bookable team members in the returned result (true) or not (false).
Default: false
limit Integer Query, Optional The maximum number of results to return.
cursor String Query, Optional The cursor for paginating through the results.
location_id String Query, Optional Indicates whether to include only team members enabled at the given location in the returned result.

Response Type

List Team Member Booking Profiles Response Hash

Example Usage

bookable_only = false
limit = 172
cursor = 'cursor6'
location_id = 'location_id4'

result = bookings_api.list_team_member_booking_profiles(bookable_only: bookable_only, limit: limit, cursor: cursor, location_id: location_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Retrieve Team Member Booking Profile

Retrieves a team member's booking profile.

def retrieve_team_member_booking_profile(team_member_id:)

Parameters

Parameter Type Tags Description
team_member_id String Template, Required The ID of the team member to retrieve.

Response Type

Retrieve Team Member Booking Profile Response Hash

Example Usage

team_member_id = 'team_member_id0'

result = bookings_api.retrieve_team_member_booking_profile(team_member_id: team_member_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Retrieve Booking

Retrieves a booking.

def retrieve_booking(booking_id:)

Parameters

Parameter Type Tags Description
booking_id String Template, Required The ID of the Booking object representing the to-be-retrieved booking.

Response Type

Retrieve Booking Response Hash

Example Usage

booking_id = 'booking_id4'

result = bookings_api.retrieve_booking(booking_id: booking_id)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Update Booking

Updates a booking.

def update_booking(booking_id:,
                   body:)

Parameters

Parameter Type Tags Description
booking_id String Template, Required The ID of the Booking object representing the to-be-updated booking.
body Update Booking Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Update Booking Response Hash

Example Usage

booking_id = 'booking_id4'
body = {}
body[:idempotency_key] = 'idempotency_key2'
body[:booking] = {}
body[:booking][:id] = 'id8'
body[:booking][:version] = 148
body[:booking][:status] = 'ACCEPTED'
body[:booking][:created_at] = 'created_at6'
body[:booking][:updated_at] = 'updated_at4'

result = bookings_api.update_booking(booking_id: booking_id, body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end

Cancel Booking

Cancels an existing booking.

def cancel_booking(booking_id:,
                   body:)

Parameters

Parameter Type Tags Description
booking_id String Template, Required The ID of the Booking object representing the to-be-cancelled booking.
body Cancel Booking Request Hash Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Cancel Booking Response Hash

Example Usage

booking_id = 'booking_id4'
body = {}
body[:idempotency_key] = 'idempotency_key2'
body[:booking_version] = 8

result = bookings_api.cancel_booking(booking_id: booking_id, body: body)

if result.success?
  puts result.data
elsif result.error?
  warn result.errors
end