class BigMarkerClient::Api::V1::Conference::Registration

Constants

CHECK_REGISTRANT_STATUS
CREATE_REGISTRANT
DELETE_REGISTRANT
LIST_REGISTRANTS
LIST_REGISTRANTS_WITH_FIELDS

Public Class Methods

check_status(conference_id, params = {}) click to toggle source

check if a person is already registered to a conference. Recognized @params are @param conference_id [String] conference identifier @param params [Hash] recognized are:

  • bmid: a unique big_marker id of a attendee

  • email: the email of an attendee

either of these two are required @return [String] status (registered. not registered)

# File lib/big_marker_client/api/v1/conference/registration.rb, line 95
def check_status(conference_id, params = {})
  result = get(replace_path_params(path: CHECK_REGISTRANT_STATUS, replacements: { "{id}": conference_id }),
               params)
  return result["registration_status"] if result["registration_status"]

  result
end
list(conference_id, params = {}) click to toggle source

list all registrants to a conference. @param conference_id [String] conference identifier @param params [Hash] recognized are:

  • page: pagination page

  • per_page: pagination page size (20*)

@return [BigMarkerClient::Models::Registrant

# File lib/big_marker_client/api/v1/conference/registration.rb, line 20
def list(conference_id, params = {})
  result = get(replace_path_params(path: LIST_REGISTRANTS, replacements: { "{id}": conference_id }), params)
  return map_to_model_array(result["registrations"]) if result["registrations"]

  result
end
list_all(conference_id, params = {}) click to toggle source

helper method to retrieve all pages for the list method @see list

# File lib/big_marker_client/api/v1/conference/registration.rb, line 30
def list_all(conference_id, params = {})
  path = replace_path_params(path: LIST_REGISTRANTS, replacements: { "{id}": conference_id })
  loop_over(path, "registrations", ::BigMarkerClient::Models::Registrant, params)
end
list_all_with_fields(conference_id, params = {}) click to toggle source

helper method to retrieve all pages for the list_with_fields method @see list_with_fields

# File lib/big_marker_client/api/v1/conference/registration.rb, line 53
def list_all_with_fields(conference_id, params = {})
  path = replace_path_params(path: LIST_REGISTRANTS_WITH_FIELDS, replacements: { "{id}": conference_id })
  loop_over(path, "registrations", ::BigMarkerClient::Models::Registrant, params)
end
list_with_fields(conference_id, params = {}) click to toggle source

list all registrants to a conference with custom fields. @param conference_id [String] conference identifier @param params [Hash] recognized are:

  • page: pagination page

  • per_page: pagination page size (20*)

@return [BigMarkerClient::Models::Registrant

# File lib/big_marker_client/api/v1/conference/registration.rb, line 42
def list_with_fields(conference_id, params = {})
  result = get(replace_path_params(path: LIST_REGISTRANTS_WITH_FIELDS,
                                   replacements: { "{id}": conference_id }), params)
  return map_to_model_array(result["registrations"]) if result["registrations"]

  result
end
register(conference_id, email, first_name, last_name, params = {}) click to toggle source

registers a participant to a conference. @param conference_id [String] conference identifier @param email [String] attendee email @param first_name [String] attendee first name @param last_name [String] attendee last name @param params [Hash] recognized are:

  • temporary_password: a temporary password for registrant

  • custom_fields: uRL encoded JSON object, keys are custom_field ids.

  • utm_bmcr_source: registrant’s UTM source code

  • custom_user_id: external custom user id

@return [String] URL for the participant to enter the conference

# File lib/big_marker_client/api/v1/conference/registration.rb, line 70
def register(conference_id, email, first_name, last_name, params = {})
  create_params = { id: conference_id, email: email, first_name: first_name, last_name: last_name }
                  .merge(params)
  result = post(CREATE_REGISTRANT, create_params)
  return result["conference_url"] if result["conference_url"]

  result
end
unregister(conference_id, email) click to toggle source

remove a participant from a conference @param conference_id [String] conference identifier @param email [String] attendee email

# File lib/big_marker_client/api/v1/conference/registration.rb, line 83
def unregister(conference_id, email)
  delete(DELETE_REGISTRANT, { id: conference_id, email: email })
end

Private Class Methods

map_to_model_array(hash_array, model_class = ::BigMarkerClient::Models::Registrant) click to toggle source
# File lib/big_marker_client/api/v1/conference/registration.rb, line 105
def map_to_model_array(hash_array, model_class = ::BigMarkerClient::Models::Registrant)
  hash_array.map { |hash| model_class.new(hash) }
end