big_marker_client 0.1.6 → 0.1.7

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: 761022b647bdfeecdd833b29b236ff768cf2713d2d5c82a3986638d5cc67b0d5
4
- data.tar.gz: 16707b0d879dd593066b400677c343bdfa47eed6d97e5132a5f99599b94e64e6
3
+ metadata.gz: ed37646b284700f68cd35dbc2479ab9cfcfb8f03bf5ae0c48e0145ce66ad9fe8
4
+ data.tar.gz: d4690336aa4d989931f00fdff50ed6c4f328bb6b85e1a3f1d9152eb741fe7b50
5
5
  SHA512:
6
- metadata.gz: c18cf2836336c335143e01690ccbc3acdfaf96f39bc86d415270fc9e8bf8b97c5069f35d508e664a65dab94bd97cba7d191acada60fd242a710b56828229e948
7
- data.tar.gz: 12d4ca8e8394a012f395dbd910c3a9835c9a072b20e88a39167f25adecf1b77d1483cbb42a303f05774b39405fc06bcda4fc806a8056b932003c9533935b36b7
6
+ metadata.gz: ce98e4e5c230dc9d7dc5ae42c176e4bcae182b729d871eb55434f7e0db3c9c592ef82e6ce68564fc1721088bf949b6bf408ad7a0c2acce2ae111966a53fee289
7
+ data.tar.gz: bd727a006b800643ef093ca8e1e115a88644826aabaf96c1b1c59fc067d75d84451d7daecfedee75e524235aca91a3d4d7002e6861b27f2c26079f50d98da7ba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # Changelog
2
+
3
+ ## [0.1.7] - Unreleased
4
+
5
+ - fix return types for update and create are different from show
6
+ - fix attendee duration format (not integer minutes but time string)
7
+ - add attendee field `certificate_of_completion`
8
+
1
9
  ## [0.1.6] - 2022-01-19
2
10
 
3
11
  - fix recurring method to return "child_conferences"
data/Gemfile CHANGED
@@ -15,7 +15,7 @@ group :development do
15
15
  end
16
16
 
17
17
  group :test do
18
- gem "activesupport", "~> 6.0"
18
+ gem "activesupport", "~> 7.0"
19
19
  gem "factory_bot"
20
20
  gem "rspec", "~> 3.0"
21
21
  gem "webmock"
@@ -137,7 +137,7 @@ module BigMarkerClient
137
137
  def update(conference_id, body = {})
138
138
  body = body.to_h if body.is_a?(::BigMarkerClient::Models::Conference)
139
139
  result = put(replace_path_params(path: UPDATE_CONFERENCE, replacements: { "{id}": conference_id }), body)
140
- return ::BigMarkerClient::Models::Conference.new(result["conference"]) if result["conference"]
140
+ return ::BigMarkerClient::Models::Conference.new(result) if result["id"]
141
141
 
142
142
  result
143
143
  end
@@ -149,7 +149,7 @@ module BigMarkerClient
149
149
  def create(body = {})
150
150
  body = body.to_h if body.is_a?(::BigMarkerClient::Models::Base)
151
151
  result = post(CREATE_CONFERENCE, body)
152
- return ::BigMarkerClient::Models::Conference.new(result["conference"]) if result["conference"]
152
+ return ::BigMarkerClient::Models::Conference.new(result) if result["id"]
153
153
 
154
154
  result
155
155
  end
@@ -1,5 +1,5 @@
1
- require "typhoeus"
2
- require "typhoeus/adapters/faraday"
1
+ require "faraday"
2
+ require "faraday/typhoeus"
3
3
 
4
4
  module BigMarkerClient
5
5
  class Base
@@ -57,7 +57,9 @@ module BigMarkerClient
57
57
  params = params.to_json unless %w[get delete].include?(verb.to_s)
58
58
  @http_client ||= HttpClient.new
59
59
  response = @http_client.connection.send(verb.to_s, base_url(path), params)
60
- parse_body(response.body)
60
+ return parse_body(response.body) if response.success?
61
+
62
+ response.body
61
63
  end
62
64
 
63
65
  def check_preconditions(verb, path)
@@ -9,7 +9,7 @@ module BigMarkerClient
9
9
  end
10
10
 
11
11
  def api_key
12
- @api_key ||= ENV["BIGMARKER_API_KEY"]
12
+ @api_key ||= ENV.fetch("BIGMARKER_API_KEY", nil)
13
13
  end
14
14
 
15
15
  def log
@@ -4,10 +4,10 @@ module BigMarkerClient
4
4
 
5
5
  def initialize
6
6
  @connection = Faraday.new(url: Config.base_url) do |faraday|
7
+ faraday.adapter :typhoeus
7
8
  faraday = headers(faraday)
8
9
  configure_logging(faraday) if Config.log
9
10
  end
10
- @connection.adapter :typhoeus
11
11
  end
12
12
 
13
13
  private
@@ -3,10 +3,9 @@ module BigMarkerClient
3
3
  class Attendee < Base
4
4
  attr_accessor :id, :bmid, :conference_id, :email, :first_name, :last_name, :edited_in_room_display_name,
5
5
  :custom_fields, :entered_at, :leaved_at, :total_duration, :engaged_duration, :attendance_monitor,
6
- :survey_results, :time_zone, :country,
7
- :chats_count, :qas_count, :polls_count, :polls, :questions, :handouts, :browser_name,
8
- :browser_version, :device_name
9
- attr_reader :view_handout, :download_handout
6
+ :time_zone, :country, :certificate_of_completion, :chats_count, :qas_count, :polls_count, :polls,
7
+ :questions, :handouts, :browser_name, :browser_version, :device_name
8
+ attr_reader :view_handout, :download_handout, :survey_results
10
9
 
11
10
  def download_handout=(handout_array)
12
11
  @download_handout = if handout_array.nil? || !handout_array.is_a?(Array) || handout_array.empty?
@@ -16,6 +15,16 @@ module BigMarkerClient
16
15
  end
17
16
  end
18
17
 
18
+ # TODO: handout has same structure as view_handout?
19
+
20
+ def survey_results=(results_array)
21
+ @survey_results = if results_array.nil? || !results_array.is_a?(Array) || results_array.empty?
22
+ []
23
+ else
24
+ results_array.map { |result_hash| SurveyResult.new(result_hash) }
25
+ end
26
+ end
27
+
19
28
  def view_handout=(handout_array)
20
29
  @view_handout = if handout_array.nil? || !handout_array.is_a?(Array) || handout_array.empty?
21
30
  []
@@ -6,6 +6,8 @@ module BigMarkerClient
6
6
 
7
7
  def timestamp=(timestamp)
8
8
  @timestamp = DateTime.strptime(timestamp, "%m/%d/%Y %H:%M:%S %z") unless timestamp.nil? || timestamp == ""
9
+ rescue Date::Error
10
+ @timestamp = nil
9
11
  end
10
12
  end
11
13
  end
@@ -6,7 +6,9 @@ module BigMarkerClient
6
6
  :presenter_dial_in_id, :presenter_dial_in_passcode, :title, :bio, :can_manage, :is_moderator,
7
7
  :facebook, :twitter, :linkedin, :website,
8
8
  # for presenter creation
9
- :presenter_temporary_password, :send_email_invite, :add_to_channel_subscriber_list
9
+ :presenter_temporary_password, :send_email_invite, :add_to_channel_subscriber_list,
10
+ :enter_as_attendee, :remove_bigmarker_contact_option, :show_on_networking_center,
11
+ :show_chat_icon_in_booth_or_session_room
10
12
 
11
13
  # differences between creation and retrieval, use creation as leading (oh well)
12
14
  alias display_name name
@@ -0,0 +1,18 @@
1
+ module BigMarkerClient
2
+ module Models
3
+ class SurveyResult < Base
4
+ attr_accessor :question, :email, :response
5
+ attr_reader :date
6
+
7
+ def date=(date_str)
8
+ @date = Date.strptime(date_str, "%a, %b %d, %Y") unless date_str.nil? || date_str == ""
9
+ rescue Date::Error
10
+ @date = nil
11
+ end
12
+
13
+ def answered?
14
+ !response.nil? && response != ""
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module BigMarkerClient
2
- VERSION = "0.1.6".freeze
2
+ VERSION = "0.1.7".freeze
3
3
  end
@@ -32,6 +32,7 @@ module BigMarkerClient
32
32
  autoload :PreloadFile, "big_marker_client/models/preload_file"
33
33
  autoload :Presenter, "big_marker_client/models/presenter"
34
34
  autoload :Registrant, "big_marker_client/models/registrant"
35
+ autoload :SurveyResult, "big_marker_client/models/survey_result"
35
36
  autoload :WebinarStats, "big_marker_client/models/webinar_stats"
36
37
  end
37
38
  end
@@ -10,8 +10,8 @@ FactoryBot.define do
10
10
  custom_fields { [] }
11
11
  entered_at { (Time.now - (60 * BigMarkerClient::TestSupport::MINUTES)).strftime("%FT%T%:z") }
12
12
  leaved_at { Time.now.strftime("%FT%T%:z") }
13
- total_duration { "3600" }
14
- engaged_duration { "240" }
13
+ total_duration { Time.at(rand * 120 * 60).utc.strftime("%T") }
14
+ engaged_duration { Time.at(rand * 120 * 60).utc.strftime("%T") }
15
15
  attendance_monitor { { "show_popup" => 0, "click_popup" => 0 } }
16
16
  survey_results { [] }
17
17
  time_zone { "Europe/Berlin" }
@@ -27,6 +27,7 @@ FactoryBot.define do
27
27
  device_name { "desktop" }
28
28
  download_handout { [] }
29
29
  view_handout { [] }
30
+ certificate_of_completion { "" }
30
31
 
31
32
  initialize_with do
32
33
  new(id: id, bmid: bmid, conference_id: conference_id, email: email, first_name: first_name, last_name: last_name,
@@ -36,7 +37,7 @@ FactoryBot.define do
36
37
  time_zone: time_zone, country: country, chats_count: chats_count, qas_count: qas_count,
37
38
  polls_count: polls_count, polls: polls, questions: questions, handouts: handouts, browser_name: browser_name,
38
39
  browser_version: browser_version, device_name: device_name, download_handout: download_handout,
39
- view_handout: view_handout)
40
+ view_handout: view_handout, certificate_of_completion: certificate_of_completion)
40
41
  end
41
42
 
42
43
  trait :with_view_handouts do
@@ -24,6 +24,10 @@ FactoryBot.define do
24
24
  presenter_temporary_password { "secret" }
25
25
  send_email_invite { true }
26
26
  add_to_channel_subscriber_list { false }
27
+ enter_as_attendee { false }
28
+ remove_bigmarker_contact_option { true }
29
+ show_on_networking_center { true }
30
+ show_chat_icon_in_booth_or_session_room { true }
27
31
 
28
32
  initialize_with do
29
33
  new(presenter_id: presenter_id, member_id: member_id, conference_id: conference_id, name: name,
@@ -34,7 +38,10 @@ FactoryBot.define do
34
38
  title: title, bio: bio, can_manage: can_manage, is_moderator: is_moderator, facebook: facebook,
35
39
  twitter: twitter, linkedin: linkedin, website: website,
36
40
  presenter_temporary_password: presenter_temporary_password, send_email_invite: send_email_invite,
37
- add_to_channel_subscriber_list: add_to_channel_subscriber_list)
41
+ add_to_channel_subscriber_list: add_to_channel_subscriber_list, enter_as_attendee: enter_as_attendee,
42
+ remove_bigmarker_contact_option: remove_bigmarker_contact_option,
43
+ show_on_networking_center: show_on_networking_center,
44
+ show_chat_icon_in_booth_or_session_room: show_chat_icon_in_booth_or_session_room)
38
45
  end
39
46
  end
40
47
  end
@@ -0,0 +1,12 @@
1
+ FactoryBot.define do
2
+ factory :big_marker_survey_result, class: "BigMarkerClient::Models::SurveyResult" do
3
+ sequence(:question) { |n| "question #{n}" }
4
+ sequence(:email) { |n| "attendee-email#{n}@example.com" }
5
+ date { Date.today.strftime("%a, %b %d, %Y") }
6
+ response { "response" }
7
+
8
+ initialize_with do
9
+ new(question: question, email: email, date: date, response: response)
10
+ end
11
+ end
12
+ 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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burkhard Vogel-Kreykenbohm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-19 00:00:00.000000000 Z
11
+ date: 2022-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday-httpclient
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: json
42
+ name: faraday-typhoeus
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: typhoeus
56
+ name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
61
+ version: '2.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.0'
68
+ version: '2.0'
69
69
  description: Encapsulates calls to the BigMarker API to create ond retrieve conferences,
70
70
  participants, analytics and more
71
71
  email:
@@ -101,6 +101,7 @@ files:
101
101
  - lib/big_marker_client/models/preload_file.rb
102
102
  - lib/big_marker_client/models/presenter.rb
103
103
  - lib/big_marker_client/models/registrant.rb
104
+ - lib/big_marker_client/models/survey_result.rb
104
105
  - lib/big_marker_client/models/webinar_stats.rb
105
106
  - lib/big_marker_client/test_support.rb
106
107
  - lib/big_marker_client/version.rb
@@ -111,6 +112,7 @@ files:
111
112
  - spec/factories/big_marker/preload_file.rb
112
113
  - spec/factories/big_marker/presenter.rb
113
114
  - spec/factories/big_marker/registrant.rb
115
+ - spec/factories/big_marker/survey_result.rb
114
116
  - spec/factories/big_marker/webinar_stats.rb
115
117
  homepage: https://gitlab.com/capinside-oss/big_marker_client
116
118
  licenses:
@@ -132,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
134
  - !ruby/object:Gem::Version
133
135
  version: '0'
134
136
  requirements: []
135
- rubygems_version: 3.2.32
137
+ rubygems_version: 3.3.7
136
138
  signing_key:
137
139
  specification_version: 4
138
140
  summary: simple client library to access the BigMarker API