Class: BigMarkerClient::Api::V1::Conference::Registration
- Defined in:
- lib/big_marker_client/api/v1/conference/registration.rb
Constant Summary collapse
- LIST_REGISTRANTS =
"/conferences/registrations/{id}".freeze
- LIST_REGISTRANTS_WITH_FIELDS =
"/conferences/registrations_with_fields/{id}".freeze
- CREATE_REGISTRANT =
"/conferences/register".freeze
- DELETE_REGISTRANT =
"/conferences/register".freeze
- CHECK_REGISTRANT_STATUS =
"/conferences/{id}/check_registration_status".freeze
Constants inherited from Base
Class Method Summary collapse
-
.check_status(conference_id, params = {}) ⇒ String
check if a person is already registered to a conference.
-
.list(conference_id, params = {}) ⇒ BigMarkerClient::Models::Registrant[]
list all registrants to a conference.
-
.list_all(conference_id, params = {}) ⇒ Object
helper method to retrieve all pages for the #list method.
-
.list_all_with_fields(conference_id, params = {}) ⇒ Object
helper method to retrieve all pages for the #list_with_fields method.
-
.list_with_fields(conference_id, params = {}) ⇒ BigMarkerClient::Models::Registrant[]
list all registrants to a conference with custom fields.
-
.register(conference_id, email, first_name, last_name, params = {}) ⇒ String
registers a participant to a conference.
-
.unregister(conference_id, email) ⇒ Object
remove a participant from a conference.
Methods inherited from Base
Class Method Details
.check_status(conference_id, params = {}) ⇒ String
check if a person is already registered to a conference. Recognized @params are
-
bmid: a unique big_marker id of a attendee
-
email: the email of an attendee
either of these two are required
95 96 97 98 99 100 101 |
# 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 = {}) ⇒ BigMarkerClient::Models::Registrant[]
list all registrants to a conference.
-
page: pagination page
-
per_page: pagination page size (20*)
20 21 22 23 24 25 |
# 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 = {}) ⇒ Object
helper method to retrieve all pages for the #list method
30 31 32 33 |
# 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 = {}) ⇒ Object
helper method to retrieve all pages for the #list_with_fields method
53 54 55 56 |
# 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 = {}) ⇒ BigMarkerClient::Models::Registrant[]
list all registrants to a conference with custom fields.
-
page: pagination page
-
per_page: pagination page size (20*)
42 43 44 45 46 47 48 |
# 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 = {}) ⇒ String
registers a participant to a conference.
-
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
70 71 72 73 74 75 76 77 |
# 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) ⇒ Object
remove a participant from a conference
83 84 85 |
# 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 |