big_marker_client 0.1.0 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1a6a622923e26061eda112840cf1945fdad94ec0f6762639e12734cad427aba
4
- data.tar.gz: 138e902bd344d8db58402ba439981c6a93e0a2e570ef2412692e49dc6d67a016
3
+ metadata.gz: d6fb91b5a5354ae4629ec265e53476357d78dbd65da6996cf24de3c7866a3402
4
+ data.tar.gz: cadac9e803e07b4836b3a6008a825f976884877196852b9573fbc33c59f35386
5
5
  SHA512:
6
- metadata.gz: 51781618326aa7412c2ef978842394e6de4a83d093c5b18b85be4e0331d5c0c1a46c6c908f9d613732898c1416dd7cbadbaccb7d3f2f46db1e641c123620e449
7
- data.tar.gz: 76bb29ba4b87ef94a2e68edf860c0d44c9795234b17a78006322d1ce35ff99e609f43d98b520b25e05765b74dcdc25d571228fe9fb1f23acff3991f5b492bb3f
6
+ metadata.gz: 62a7c90fe1839b181dfe1f3103933de22053e7330a9e17044d17c5323a67929bd23bf9c1f81d8741807d56018c1c40c4b9a8765ecc6ed9137bd9ff4496cf5628
7
+ data.tar.gz: c08e7e125dc6fd43a8174f40d0c52d300431704030436b36f6afe942c379b081b9a1106b9aaf3a9254bd801ad6810a86dce4e12edc2ba5d78dd62ba76021911a
data/.rubocop.yml CHANGED
@@ -18,6 +18,10 @@ Metrics/BlockLength:
18
18
  - "spec/**/*"
19
19
  - "big_marker_client.gemspec"
20
20
 
21
+ Performance/StringIdentifierArgument:
22
+ Exclude:
23
+ - "lib/big_marker_client/base.rb"
24
+
21
25
  Style/Documentation:
22
26
  Enabled: false
23
27
 
data/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
- ## [Unreleased]
1
+ ## [0.1.4] - 2022-01-18
2
+
3
+ - add new properties to attendees and add handout model and factory
4
+
5
+ ## [0.1.3] - 2022-01-11
6
+
7
+ - add helper methods to iterate over all pages for paginated requests
8
+
9
+ ## [0.1.2] - 2022-01-07
10
+
11
+ - actually package the factories into the gem
12
+
13
+ ## [0.1.1] - 2022-01-07
14
+
15
+ - additional properties `time_zone` and `country` on registrant
16
+ - factories for external testing
2
17
 
3
18
  ## [0.1.0] - 2021-12-10
4
19
 
data/Gemfile CHANGED
@@ -15,6 +15,8 @@ group :development do
15
15
  end
16
16
 
17
17
  group :test do
18
+ gem "activesupport", "~> 6.0"
19
+ gem "factory_bot"
18
20
  gem "rspec", "~> 3.0"
19
21
  gem "webmock"
20
22
  end
data/README.md CHANGED
@@ -30,9 +30,13 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
30
30
 
31
31
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
32
 
33
+ ## Note
34
+
35
+ Only a limited set of all API functions are currently implemented, however the existing framework makes implementing further functions extremely lightweight and easy.
36
+
33
37
  ## Contributing
34
38
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bigmarker_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/bigmarker_client/blob/master/CODE_OF_CONDUCT.md).
39
+ Bug reports and pull requests are welcome on GitHub at https://gitlab.com/capinside-oss/big_marker_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/capinside-oss/big_marker_client/-/blob/main/CODE_OF_CONDUCT.md).
36
40
 
37
41
  ## License
38
42
 
@@ -40,4 +44,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
44
 
41
45
  ## Code of Conduct
42
46
 
43
- Everyone interacting in the BigMarkerClient project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/bigmarker_client/blob/master/CODE_OF_CONDUCT.md).
47
+ Everyone interacting in the BigMarkerClient project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/capinside-oss/big_marker_client/-/blob/main/CODE_OF_CONDUCT.md).
@@ -24,6 +24,14 @@ module BigMarkerClient
24
24
  result
25
25
  end
26
26
 
27
+ ##
28
+ # helper method to retrieve all pages for the #list method
29
+ # @see #list
30
+ def list_all(conference_id, params = {})
31
+ path = replace_path_params(path: LIST_REGISTRANTS, replacements: { "{id}": conference_id })
32
+ loop_over(path, "registrations", ::BigMarkerClient::Models::Registrant, params)
33
+ end
34
+
27
35
  ##
28
36
  # list all registrants to a conference with custom fields.
29
37
  # @param conference_id [String] conference identifier
@@ -39,6 +47,14 @@ module BigMarkerClient
39
47
  result
40
48
  end
41
49
 
50
+ ##
51
+ # helper method to retrieve all pages for the #list_with_fields method
52
+ # @see #list_with_fields
53
+ def list_all_with_fields(conference_id, params = {})
54
+ path = replace_path_params(path: LIST_REGISTRANTS_WITH_FIELDS, replacements: { "{id}": conference_id })
55
+ loop_over(path, "registrations", ::BigMarkerClient::Models::Registrant, params)
56
+ end
57
+
42
58
  ##
43
59
  # registers a participant to a conference.
44
60
  # @param conference_id [String] conference identifier
@@ -86,8 +102,8 @@ module BigMarkerClient
86
102
 
87
103
  private
88
104
 
89
- def map_to_model_array(hash_array)
90
- hash_array.map { |hash| ::BigMarkerClient::Models::Registrant.new(hash) }
105
+ def map_to_model_array(hash_array, model_class = ::BigMarkerClient::Models::Registrant)
106
+ hash_array.map { |hash| model_class.new(hash) }
91
107
  end
92
108
  end
93
109
  end
@@ -20,7 +20,8 @@ module BigMarkerClient
20
20
  # @param params [Hash] recognized are:
21
21
  # - role: Filter by member role (all*, hosting, attending)
22
22
  # - type: Filter by conference type (future*, past, all, multiple_times, future_do_not_include_happening,
23
- # future_with_24_hour_room, past_with_recording, always_open, happening_now)
23
+ # future_with_24_hour_room, past_with_recording, always_open,
24
+ # happening_now)
24
25
  # - query: search in conference title
25
26
  # - page: pagination page
26
27
  # - page_count: pagination page size (20*), ATTENTION: this is called per_page everywhere else!
@@ -33,6 +34,14 @@ module BigMarkerClient
33
34
  result
34
35
  end
35
36
 
37
+ ##
38
+ # helper method to retrieve all pages for the #list method
39
+ # @see #list
40
+ def list_all(params = {})
41
+ params["page_count"] ||= params["per_page"] if params["per_page"]
42
+ loop_over(LIST_CONFERENCES, "conferences", ::BigMarkerClient::Models::Conference, params)
43
+ end
44
+
36
45
  ##
37
46
  # search for conferences with specific matching criteria.
38
47
  # @param params [Hash] recognized are:
@@ -54,6 +63,13 @@ module BigMarkerClient
54
63
  result
55
64
  end
56
65
 
66
+ ##
67
+ # helper method to retrieve all pages for the #search method
68
+ # @see #search
69
+ def search_all(params = {})
70
+ loop_over(SEARCH_CONFERENCES, "conferences", ::BigMarkerClient::Models::Conference, params, :post)
71
+ end
72
+
57
73
  ##
58
74
  # get one conference based on it's ID
59
75
  # @param conference_id [String] conference identifier
@@ -80,6 +96,14 @@ module BigMarkerClient
80
96
  result
81
97
  end
82
98
 
99
+ ##
100
+ # helper method to retrieve all pages for the #associated_series method
101
+ # @see #associated_series
102
+ def associated_series_all(conference_id, params = {})
103
+ path = replace_path_params(path: ASSOCIATED_SERIES_CONFERENCES, replacements: { "{id}": conference_id })
104
+ loop_over(path, "conferences", ::BigMarkerClient::Models::Conference, params)
105
+ end
106
+
83
107
  ##
84
108
  # get child conferences of a parent recurring conference.
85
109
  # @param conference_id [String] conference identifier
@@ -97,6 +121,14 @@ module BigMarkerClient
97
121
  result
98
122
  end
99
123
 
124
+ ##
125
+ # helper method to retrieve all pages for the #recurring method
126
+ # @see #recurring
127
+ def recurring_all(conference_id, params = {})
128
+ path = replace_path_params(path: RECURRING_CONFERENCES, replacements: { "{id}": conference_id })
129
+ loop_over(path, "conferences", ::BigMarkerClient::Models::Conference, params)
130
+ end
131
+
100
132
  ##
101
133
  # update a conference either with a Models::Conference object or single properties as hash
102
134
  # @param conference_id [String] conference identifier
@@ -175,6 +207,14 @@ module BigMarkerClient
175
207
  result
176
208
  end
177
209
 
210
+ ##
211
+ # helper method to retrieve all pages for the #attendees method
212
+ # @see #attendees
213
+ def attendees_all(conference_id, params = {})
214
+ path = replace_path_params(path: GET_CONFERENCE_ATTENDEES, replacements: { "{id}": conference_id })
215
+ loop_over(path, "attendees", ::BigMarkerClient::Models::Attendee, params)
216
+ end
217
+
178
218
  private
179
219
 
180
220
  def map_to_model_array(hash_array, model_class = ::BigMarkerClient::Models::Conference)
@@ -32,6 +32,20 @@ module BigMarkerClient
32
32
  new_path
33
33
  end
34
34
 
35
+ def loop_over(path, field, model_class, params = {}, method = :get)
36
+ page = 1
37
+ results = []
38
+ loop do
39
+ params[:page] = page
40
+ result = send(method, path, params)
41
+ results += map_to_model_array(result[field], model_class) if result[field]
42
+ break if page >= result["total_pages"].to_i || results.length >= total_count(result).to_i
43
+
44
+ page += 1
45
+ end
46
+ results
47
+ end
48
+
35
49
  private
36
50
 
37
51
  def request(path:, verb: :get, params: {})
@@ -86,6 +100,13 @@ module BigMarkerClient
86
100
  rescue JSON::ParserError
87
101
  raise BigMarkerClient::ResponseError, "invalid response"
88
102
  end
103
+
104
+ ##
105
+ # conferences#list is a total mess as requests require `page_count` instead of `per_page` as everywhere else and
106
+ # ti will return `total_count` instead of `total_entries` compared to the rest
107
+ def total_count(response)
108
+ response["total_entries"] || response["total_count"]
109
+ end
89
110
  end
90
111
  end
91
112
  end
@@ -1,9 +1,28 @@
1
1
  module BigMarkerClient
2
2
  module Models
3
3
  class Attendee < Base
4
- attr_accessor :email, :first_name, :last_name, :entered_at, :leaved_at, :total_duration, :engaged_duration,
4
+ attr_accessor :id, :bmid, :conference_id, :email, :first_name, :last_name, :edited_in_room_display_name,
5
+ :custom_fields, :entered_at, :leaved_at, :total_duration, :engaged_duration, :attendance_monitor,
6
+ :survey_results, :time_zone, :country,
5
7
  :chats_count, :qas_count, :polls_count, :polls, :questions, :handouts, :browser_name,
6
8
  :browser_version, :device_name
9
+ attr_reader :view_handout, :download_handout
10
+
11
+ def download_handout=(handout_array)
12
+ @download_handout = if handout_array.nil? || !handout_array.is_a?(Array) || handout_array.empty?
13
+ []
14
+ else
15
+ handout_array.map { |handout_hash| Handout.new(handout_hash) }
16
+ end
17
+ end
18
+
19
+ def view_handout=(handout_array)
20
+ @view_handout = if handout_array.nil? || !handout_array.is_a?(Array) || handout_array.empty?
21
+ []
22
+ else
23
+ handout_array.map { |handout_hash| Handout.new(handout_hash) }
24
+ end
25
+ end
7
26
  end
8
27
  end
9
28
  end
@@ -0,0 +1,12 @@
1
+ module BigMarkerClient
2
+ module Models
3
+ class Handout < Base
4
+ attr_accessor :type, :email, :content, :source_from
5
+ attr_reader :timestamp
6
+
7
+ def timestamp=(timestamp)
8
+ @timestamp = DateTime.strptime(timestamp, "%m/%d/%Y %H:%M:%S %z") unless timestamp.nil? || timestamp == ""
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,7 +2,7 @@ module BigMarkerClient
2
2
  module Models
3
3
  class Registrant < Base
4
4
  attr_accessor :email, :first_name, :last_name, :custom_fields, :enter_url, :bmid, :referral_domain, :source,
5
- :tracking_code, :custom_user_id
5
+ :tracking_code, :custom_user_id, :time_zone, :country
6
6
  end
7
7
  end
8
8
  end
@@ -0,0 +1,7 @@
1
+ module BigMarkerClient
2
+ module TestSupport
3
+ FACTORY_PATH = File.expand_path("../../spec/factories", __dir__)
4
+ MINUTES = 60
5
+ DAYS = 24 * 60 * 60
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module BigMarkerClient
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
@@ -27,6 +27,7 @@ module BigMarkerClient
27
27
  autoload :Base, "big_marker_client/models/base"
28
28
  autoload :Conference, "big_marker_client/models/conference"
29
29
  autoload :DialInInformation, "big_marker_client/models/dial_in_information"
30
+ autoload :Handout, "big_marker_client/models/handout"
30
31
  autoload :PreloadFile, "big_marker_client/models/preload_file"
31
32
  autoload :Presenter, "big_marker_client/models/presenter"
32
33
  autoload :Registrant, "big_marker_client/models/registrant"
@@ -0,0 +1,50 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_attendee, class: "BigMarkerClient::Models::Attendee" do
3
+ sequence(:id)
4
+ sequence(:bmid) { SecureRandom.hex(6) }
5
+ sequence(:conference_id) { SecureRandom.hex(6) }
6
+ sequence(:email) { |n| "attendee#{n}@example.com" }
7
+ first_name { "Attendee first name" }
8
+ last_name { "Attendee last name" }
9
+ edited_in_room_display_name { nil }
10
+ custom_fields { [] }
11
+ entered_at { (Time.now - (60 * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
12
+ leaved_at { Time.now.strftime("%FT%T%:z") }
13
+ total_duration { "3600" }
14
+ engaged_duration { "240" }
15
+ attendance_monitor { { "show_popup" => 0, "click_popup" => 0 } }
16
+ survey_results { [] }
17
+ time_zone { "Europe/Berlin" }
18
+ country { "Germany" }
19
+ chats_count { 1 }
20
+ qas_count { 0 }
21
+ polls_count { 2 }
22
+ polls { %w[poll1 poll2] }
23
+ questions { [] }
24
+ handouts { %w[doc1 doc2 doc3] }
25
+ browser_name { "Google Chrome" }
26
+ browser_version { 96 }
27
+ device_name { "desktop" }
28
+ download_handout { [] }
29
+ view_handout { [] }
30
+
31
+ initialize_with do
32
+ new(id: id, bmid: bmid, conference_id: conference_id, email: email, first_name: first_name, last_name: last_name,
33
+ edited_in_room_display_name: edited_in_room_display_name, custom_fields: custom_fields,
34
+ entered_at: entered_at, leaved_at: leaved_at, total_duration: total_duration,
35
+ engaged_duration: engaged_duration, attendance_monitor: attendance_monitor, survey_results: survey_results,
36
+ time_zone: time_zone, country: country, chats_count: chats_count, qas_count: qas_count,
37
+ polls_count: polls_count, polls: polls, questions: questions, handouts: handouts, browser_name: browser_name,
38
+ browser_version: browser_version, device_name: device_name, download_handout: download_handout,
39
+ view_handout: view_handout)
40
+ end
41
+
42
+ trait :with_view_handouts do
43
+ view_handout { build_list(:big_marker_handout, 1, :view_handout) }
44
+ end
45
+
46
+ trait :with_download_handouts do
47
+ download_handout { build_list(:big_marker_handout, 1, :download_handout) }
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,115 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_conference, class: "BigMarkerClient::Models::Conference" do
3
+ transient do
4
+ start_time_obj { Time.now + (3 * BigMarkerClient::TestSupport::DAYS) }
5
+ end
6
+
7
+ id { SecureRandom.hex(6) }
8
+ sequence(:title) { |n| "BigMarker Conference #{n}" }
9
+ event_type { "webinar" }
10
+ display_language { "German(Customized)" }
11
+ meeting_mode { false }
12
+ type { "live_webinar" }
13
+ conference_copy_id { SecureRandom.hex(6) }
14
+ master_webinar_id { nil }
15
+ max_attendance { 500 }
16
+ purpose { "BigMarker event description" }
17
+ start_time { start_time_obj.strftime("%FT%T%:z") }
18
+ duration_minutes { 60 }
19
+ sequence(:conference_address) { |n| "https://host.example.com/example_channel/event-#{n}" }
20
+ custom_event_id { nil }
21
+ channel_id { "example_channel" }
22
+ webcast_mode { "automatic" }
23
+ end_time { (start_time_obj + (duration_minutes * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
24
+ moderator_open_time { (start_time_obj - (30 * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
25
+ audience_open_time { (start_time_obj - (15 * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
26
+ first_admin_enter_time { (start_time_obj - (60 * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
27
+ manual_end_time { nil }
28
+ privacy { "public" }
29
+ exit_url { "https://host.example.com" }
30
+ enable_registration_email { true }
31
+ enable_knock_to_enter { false }
32
+ send_reminder_emails_to_presenters { true }
33
+ review_emails { true }
34
+ poll_results { false }
35
+ enable_ie_safari { true }
36
+ enable_twitter { true }
37
+ auto_invite_all_channel_members { false }
38
+ send_cancellation_email { false }
39
+ show_reviews { false }
40
+ registration_required_to_view_recording { true }
41
+ who_can_watch_recording { "everyone" }
42
+ show_handout_on_page { true }
43
+ background_image_url { nil }
44
+ room_logo { nil }
45
+ agenda_topics { [] }
46
+ disclaimer { "disclaimer" }
47
+ recorded { false }
48
+ recording_url { nil }
49
+ recording_iframe { nil }
50
+ sequence(:sub_url) { |n| "event-#{n}" }
51
+ enable_dial_in { true }
52
+ time_zone { "Europe/Berlin" }
53
+ schedule_type { "one_time" }
54
+ recurring_start_times { [] }
55
+ presenter_advanced_enter_time { 60 }
56
+ attendee_advanced_enter_time { 15 }
57
+ webinar_format { "webinar" }
58
+ registration_conf_emails { true }
59
+ send_notification_emails_to_presenters { true }
60
+ webhook_url { nil }
61
+ channel_admin_id { nil }
62
+ free_for_all { false }
63
+ room_type { nil }
64
+ room_sub_title { nil }
65
+ dial_in_information { nil }
66
+ preload_files { [] }
67
+ presenters { [] }
68
+ webinar_stats { nil }
69
+ associated_series { [] }
70
+
71
+ initialize_with do
72
+ new(id: id, title: title, event_type: event_type, display_language: display_language, meeting_mode: meeting_mode,
73
+ type: type, conference_copy_id: conference_copy_id, master_webinar_id: master_webinar_id,
74
+ max_attendance: max_attendance, purpose: purpose, start_time: start_time, duration_minutes: duration_minutes,
75
+ channel_id: channel_id, conference_address: conference_address, custom_event_id: custom_event_id,
76
+ webcast_mode: webcast_mode, end_time: end_time, moderator_open_time: moderator_open_time,
77
+ audience_open_time: audience_open_time, first_admin_enter_time: first_admin_enter_time,
78
+ manual_end_time: manual_end_time, privacy: privacy, exit_url: exit_url,
79
+ enable_registration_email: enable_registration_email, enable_knock_to_enter: enable_knock_to_enter,
80
+ review_emails: review_emails, send_reminder_emails_to_presenters: send_reminder_emails_to_presenters,
81
+ poll_results: poll_results, enable_ie_safari: enable_ie_safari, enable_twitter: enable_twitter,
82
+ auto_invite_all_channel_members: auto_invite_all_channel_members,
83
+ send_cancellation_email: send_cancellation_email, show_reviews: show_reviews,
84
+ registration_required_to_view_recording: registration_required_to_view_recording,
85
+ who_can_watch_recording: who_can_watch_recording, show_handout_on_page: show_handout_on_page,
86
+ background_image_url: background_image_url, room_logo: room_logo, agenda_topics: agenda_topics,
87
+ disclaimer: disclaimer, recorded: recorded, recording_url: recording_url, recording_iframe: recording_iframe,
88
+ sub_url: sub_url, enable_dial_in: enable_dial_in, time_zone: time_zone, schedule_type: schedule_type,
89
+ recurring_start_times: recurring_start_times, presenter_advanced_enter_time: presenter_advanced_enter_time,
90
+ attendee_advanced_enter_time: attendee_advanced_enter_time, webinar_format: webinar_format,
91
+ registration_conf_emails: registration_conf_emails,
92
+ send_notification_emails_to_presenters: send_notification_emails_to_presenters,
93
+ webhook_url: webhook_url, channel_admin_id: channel_admin_id, free_for_all: free_for_all,
94
+ room_type: room_type, room_sub_title: room_sub_title, dial_in_information: dial_in_information,
95
+ preload_files: preload_files, presenters: presenters, webinar_stats: webinar_stats,
96
+ associated_series: associated_series)
97
+ end
98
+
99
+ trait :with_presenters do
100
+ presenters { build_list(:big_marker_presenter, 2, conference_id: id).map(&:to_h) }
101
+ end
102
+
103
+ trait :with_dial_in_information do
104
+ dial_in_information { build(:big_marker_dial_in_information).to_h }
105
+ end
106
+
107
+ trait :with_preload_files do
108
+ preload_files { build_list(:big_marker_preload_file, 2).map(&:to_h) }
109
+ end
110
+
111
+ trait :with_webinar_stats do
112
+ webinar_stats { build(:big_marker_webinar_stats).to_h }
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,16 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_dial_in_information, class: "BigMarkerClient::Models::DialInInformation" do
3
+ dial_in_number { "+1 (312) 248-9348" }
4
+ dial_in_id { "123456#" }
5
+ dial_in_passcode { "1234#" }
6
+ presenter_dial_in_number { "+1 (312) 248-9348" }
7
+ presenter_dial_in_id { "234567#" }
8
+ presenter_dial_in_passcode { "345678#" }
9
+
10
+ initialize_with do
11
+ new(dial_in_number: dial_in_number, dial_in_id: dial_in_id, dial_in_passcode: dial_in_passcode,
12
+ presenter_dial_in_number: presenter_dial_in_number, presenter_dial_in_id: presenter_dial_in_id,
13
+ presenter_dial_in_passcode: presenter_dial_in_passcode)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_handout, class: "BigMarkerClient::Models::Handout" do
3
+ type { "handout" }
4
+ sequence(:email) { |n| "attendee-email#{n}@example.com" }
5
+ sequence(:content) { |n| "some_file_name#{n}.pdf" }
6
+ timestamp { Time.now.strftime("%m/%d/%Y %H:%M:%S %z") }
7
+ source_from { "Live Webinar" }
8
+
9
+ trait :view_handout do
10
+ type { "view_handout" }
11
+ end
12
+
13
+ trait :download_handout do
14
+ type { "download_handout" }
15
+ end
16
+
17
+ initialize_with do
18
+ new(type: type, email: email, content: content, timestamp: timestamp, source_from: source_from)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,10 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_preload_file, class: "BigMarkerClient::Models::PreloadFile" do
3
+ id { SecureRandom.hex(6) }
4
+ sequence(:file_name) { |n| "presentation_#{n}.pdf" }
5
+ file_type { "whiteboard" }
6
+ file_url { "https://host.example.com/content_object_shared_files/some_hash/#{file_name}{?token" }
7
+
8
+ initialize_with { new(id: id, file_name: file_name, file_type: file_type, file_url: file_url) }
9
+ end
10
+ end
@@ -0,0 +1,40 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_presenter, class: "BigMarkerClient::Models::Presenter" do
3
+ presenter_id { SecureRandom.hex(6) }
4
+ member_id { SecureRandom.hex(6) }
5
+ conference_id { SecureRandom.hex(6) }
6
+ name { "Presenter first name Presenter last name" }
7
+ display_on_landing_page { true }
8
+ presenter_first_name { "Presenter first name" }
9
+ presenter_last_name { "Presenter last name" }
10
+ sequence(:presenter_email) { |n| "presenter.email#{n}@example.com" }
11
+ presenter_url { "https://host.example.com/conferences/#{conference_id}/presenter_content/#{presenter_id}" }
12
+ photo_url { "https://host.example.com/presenters/some_id/medium/presenter_photo.jpg?token" }
13
+ presenter_dial_in_number { "+1 (312) 248-9348" }
14
+ presenter_dial_in_id { "234567#" }
15
+ presenter_dial_in_passcode { "345678#" }
16
+ title { "Presenter title" }
17
+ bio { "Presenter bio" }
18
+ can_manage { false }
19
+ is_moderator { true }
20
+ facebook { nil }
21
+ twitter { nil }
22
+ linkedin { nil }
23
+ website { "https://www.example.com" }
24
+ presenter_temporary_password { "secret" }
25
+ send_email_invite { true }
26
+ add_to_channel_subscriber_list { false }
27
+
28
+ initialize_with do
29
+ new(presenter_id: presenter_id, member_id: member_id, conference_id: conference_id, name: name,
30
+ display_on_landing_page: display_on_landing_page, presenter_first_name: presenter_first_name,
31
+ presenter_last_name: presenter_last_name, presenter_email: presenter_email, presenter_url: presenter_url,
32
+ photo_url: photo_url, presenter_dial_in_number: presenter_dial_in_number,
33
+ presenter_dial_in_id: presenter_dial_in_id, presenter_dial_in_passcode: presenter_dial_in_passcode,
34
+ title: title, bio: bio, can_manage: can_manage, is_moderator: is_moderator, facebook: facebook,
35
+ twitter: twitter, linkedin: linkedin, website: website,
36
+ presenter_temporary_password: presenter_temporary_password, send_email_invite: send_email_invite,
37
+ add_to_channel_subscriber_list: add_to_channel_subscriber_list)
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,22 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_registrant, class: "BigMarkerClient::Models::Registrant" do
3
+ sequence(:email) { |n| "registrant.email#{n}@example.com" }
4
+ first_name { "Registrant first name" }
5
+ last_name { "Registrant last name" }
6
+ custom_fields { [] }
7
+ enter_url { "https://host.example.com/example_channel/event?bmid=#{bmid}" }
8
+ bmid { SecureRandom.hex(6) }
9
+ referral_domain { nil }
10
+ source { "Registration Modal" }
11
+ tracking_code { nil }
12
+ custom_user_id { nil }
13
+ time_zone { "Europe/Berlin" }
14
+ country { "Germany" }
15
+
16
+ initialize_with do
17
+ new(email: email, first_name: first_name, last_name: last_name, custom_fields: custom_fields,
18
+ enter_url: enter_url, bmid: bmid, referral_domain: referral_domain, source: source,
19
+ tracking_code: tracking_code, custom_user_id: custom_user_id, time_zone: time_zone, country: country)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_webinar_stats, class: "BigMarkerClient::Models::WebinarStats" do
3
+ registrants { 10 }
4
+ revenue { "$0.00" }
5
+ total_attendees { 5 }
6
+ page_views { 4 }
7
+ invited { 20 }
8
+
9
+ initialize_with do
10
+ new(registrants: registrants, revenue: revenue, total_attendees: total_attendees, page_views: page_views,
11
+ invited: invited)
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big_marker_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burkhard Vogel-Kreykenbohm
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday-httpclient
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: json
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,7 +70,9 @@ description: Encapsulates calls to the BigMarker API to create ond retrieve conf
56
70
  participants, analytics and more
57
71
  email:
58
72
  - bvk@capinside.com
59
- executables: []
73
+ executables:
74
+ - console
75
+ - setup
60
76
  extensions: []
61
77
  extra_rdoc_files: []
62
78
  files:
@@ -80,11 +96,21 @@ files:
80
96
  - lib/big_marker_client/models/base.rb
81
97
  - lib/big_marker_client/models/conference.rb
82
98
  - lib/big_marker_client/models/dial_in_information.rb
99
+ - lib/big_marker_client/models/handout.rb
83
100
  - lib/big_marker_client/models/preload_file.rb
84
101
  - lib/big_marker_client/models/presenter.rb
85
102
  - lib/big_marker_client/models/registrant.rb
86
103
  - lib/big_marker_client/models/webinar_stats.rb
104
+ - lib/big_marker_client/test_support.rb
87
105
  - lib/big_marker_client/version.rb
106
+ - spec/factories/big_marker/attendee.rb
107
+ - spec/factories/big_marker/conference.rb
108
+ - spec/factories/big_marker/dial_in_infromation.rb
109
+ - spec/factories/big_marker/handout.rb
110
+ - spec/factories/big_marker/preload_file.rb
111
+ - spec/factories/big_marker/presenter.rb
112
+ - spec/factories/big_marker/registrant.rb
113
+ - spec/factories/big_marker/webinar_stats.rb
88
114
  homepage: https://gitlab.com/capinside-oss/big_marker_client
89
115
  licenses:
90
116
  - MIT