class Fountain::Api::AvailableSlots

Fountain Slot Management API

Public Class Methods

cancel(booked_slot_id) click to toggle source

Cancel a booked session @param [String] booked_slot_id ID of the Fountain slot @param [String] applicant_id ID of the Fountain applicant @return [Fountain::Slot]

# File lib/fountain/api/available_slots.rb, line 42
def self.cancel(booked_slot_id)
  response = request(
    "/v2/booked_slots/#{booked_slot_id}/cancel",
    method: :post
  )
  check_response response
  true
end
confirm(available_slot_id, applicant_id) click to toggle source

Confirm an available slot @param [String] available_slot_id ID of the Fountain slot @param [String] applicant_id ID of the Fountain applicant @return [Fountain::Slot]

# File lib/fountain/api/available_slots.rb, line 16
def self.confirm(available_slot_id, applicant_id)
  response = request_json(
    "/v2/available_slots/#{available_slot_id}/confirm",
    method: :post,
    body: { applicant_id: applicant_id }
  )
  Fountain::Slot.new response
end
list(stage_id, list_options = {}) click to toggle source

List Available Slots @param [String] stage_id ID of the Fountain stage @return [[Fountain::Slots]]

# File lib/fountain/api/available_slots.rb, line 29
def self.list(stage_id, list_options = {})
  page_query = list_options[:page] ? "?page=#{list_options[:page]}" : ''
  response = request_json(
    "/v2/stages/#{stage_id}/available_slots#{page_query}"
  )
  Fountain::Slots.new response
end