bombbomb 2.0.20679 → 2.0.21432

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.
Files changed (40) hide show
  1. checksums.yaml +5 -13
  2. data/README.md +28 -12
  3. data/bombbomb.gemspec +1 -1
  4. data/docs/Curriculum.md +15 -0
  5. data/docs/CurriculumApi.md +109 -0
  6. data/docs/CurriculumUserProgress.md +12 -0
  7. data/docs/CurriculumWithProgress.md +15 -0
  8. data/docs/PromptsApi.md +3 -3
  9. data/docs/TeamPublicRepresentation.md +10 -0
  10. data/docs/TeamsApi.md +344 -5
  11. data/docs/UtilitiesApi.md +4 -4
  12. data/docs/WebhooksApi.md +45 -4
  13. data/lib/bombbomb.rb +6 -1
  14. data/lib/bombbomb/api/curriculum_api.rb +143 -0
  15. data/lib/bombbomb/api/prompts_api.rb +4 -4
  16. data/lib/bombbomb/api/teams_api.rb +374 -6
  17. data/lib/bombbomb/api/utilities_api.rb +5 -5
  18. data/lib/bombbomb/api/webhooks_api.rb +57 -5
  19. data/lib/bombbomb/api_client.rb +1 -1
  20. data/lib/bombbomb/api_error.rb +1 -1
  21. data/lib/bombbomb/configuration.rb +1 -1
  22. data/lib/bombbomb/models/bb_web_hook.rb +1 -1
  23. data/lib/bombbomb/models/curriculum.rb +272 -0
  24. data/lib/bombbomb/models/curriculum_user_progress.rb +240 -0
  25. data/lib/bombbomb/models/curriculum_with_progress.rb +272 -0
  26. data/lib/bombbomb/models/inline_response_200.rb +1 -1
  27. data/lib/bombbomb/models/inline_response_200_items.rb +1 -1
  28. data/lib/bombbomb/models/jericho_configuration.rb +1 -1
  29. data/lib/bombbomb/models/jericho_performance.rb +1 -1
  30. data/lib/bombbomb/models/o_auth_client.rb +1 -1
  31. data/lib/bombbomb/models/string.rb +1 -1
  32. data/lib/bombbomb/models/team_public_representation.rb +220 -0
  33. data/lib/bombbomb/models/video_email_prompt.rb +1 -1
  34. data/lib/bombbomb/version.rb +2 -2
  35. data/spec/api/curriculum_api_spec.rb +69 -0
  36. data/spec/models/curriculum_spec.rb +95 -0
  37. data/spec/models/curriculum_user_progress_spec.rb +77 -0
  38. data/spec/models/curriculum_with_progress_spec.rb +95 -0
  39. data/spec/models/team_public_representation_spec.rb +65 -0
  40. metadata +60 -40
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #BombBomb
3
+
4
+ #We make it easy to build relationships using simple videos.
5
+
6
+ OpenAPI spec version: 2.0.21432
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module BombBomb
27
+ # The CurriculumUserProgress class
28
+ class CurriculumUserProgress
29
+ # Id
30
+ attr_accessor :id
31
+
32
+ # User Id
33
+ attr_accessor :user_id
34
+
35
+ # Curriculum Item Id
36
+ attr_accessor :curriculum_item_id
37
+
38
+ # Curriculum Id
39
+ attr_accessor :curriculum_id
40
+
41
+ # When the final email is scheduled to be sent
42
+ attr_accessor :completed_date
43
+
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'id' => :'id',
49
+ :'user_id' => :'userId',
50
+ :'curriculum_item_id' => :'curriculumItemId',
51
+ :'curriculum_id' => :'curriculumId',
52
+ :'completed_date' => :'completedDate'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'id' => :'String',
60
+ :'user_id' => :'String',
61
+ :'curriculum_item_id' => :'String',
62
+ :'curriculum_id' => :'String',
63
+ :'completed_date' => :'DateTime'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
74
+
75
+ if attributes.has_key?(:'id')
76
+ self.id = attributes[:'id']
77
+ end
78
+
79
+ if attributes.has_key?(:'userId')
80
+ self.user_id = attributes[:'userId']
81
+ end
82
+
83
+ if attributes.has_key?(:'curriculumItemId')
84
+ self.curriculum_item_id = attributes[:'curriculumItemId']
85
+ end
86
+
87
+ if attributes.has_key?(:'curriculumId')
88
+ self.curriculum_id = attributes[:'curriculumId']
89
+ end
90
+
91
+ if attributes.has_key?(:'completedDate')
92
+ self.completed_date = attributes[:'completedDate']
93
+ end
94
+
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properies with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ id == o.id &&
116
+ user_id == o.user_id &&
117
+ curriculum_item_id == o.curriculum_item_id &&
118
+ curriculum_id == o.curriculum_id &&
119
+ completed_date == o.completed_date
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Fixnum] Hash code
130
+ def hash
131
+ [id, user_id, curriculum_item_id, curriculum_id, completed_date].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.swagger_types.each_pair do |key, type|
140
+ if type =~ /^Array<(.*)>/i
141
+ # check to ensure the input is an array given that the the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :DateTime
161
+ DateTime.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :BOOLEAN
171
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ temp_model = BombBomb.const_get(type).new
192
+ temp_model.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ next if value.nil?
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map{ |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -0,0 +1,272 @@
1
+ =begin
2
+ #BombBomb
3
+
4
+ #We make it easy to build relationships using simple videos.
5
+
6
+ OpenAPI spec version: 2.0.21432
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module BombBomb
27
+ # The CurriculumWithProgress class
28
+ class CurriculumWithProgress
29
+ # Collection of User Progress for Curriculum
30
+ attr_accessor :progress
31
+
32
+ # Id
33
+ attr_accessor :id
34
+
35
+ # Name
36
+ attr_accessor :name
37
+
38
+ # HTML formatted intro
39
+ attr_accessor :html_intro
40
+
41
+ # URI of header image
42
+ attr_accessor :img_url
43
+
44
+ # Number of curriculum items
45
+ attr_accessor :item_count
46
+
47
+ # Render method for curriculum
48
+ attr_accessor :render_as
49
+
50
+ # Globally visible
51
+ attr_accessor :visible_to_all_users
52
+
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'progress' => :'progress',
58
+ :'id' => :'id',
59
+ :'name' => :'name',
60
+ :'html_intro' => :'htmlIntro',
61
+ :'img_url' => :'imgUrl',
62
+ :'item_count' => :'itemCount',
63
+ :'render_as' => :'renderAs',
64
+ :'visible_to_all_users' => :'visibleToAllUsers'
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'progress' => :'Array<CurriculumUserProgress>',
72
+ :'id' => :'String',
73
+ :'name' => :'String',
74
+ :'html_intro' => :'String',
75
+ :'img_url' => :'String',
76
+ :'item_count' => :'Integer',
77
+ :'render_as' => :'String',
78
+ :'visible_to_all_users' => :'BOOLEAN'
79
+ }
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
89
+
90
+ if attributes.has_key?(:'progress')
91
+ if (value = attributes[:'progress']).is_a?(Array)
92
+ self.progress = value
93
+ end
94
+ end
95
+
96
+ if attributes.has_key?(:'id')
97
+ self.id = attributes[:'id']
98
+ end
99
+
100
+ if attributes.has_key?(:'name')
101
+ self.name = attributes[:'name']
102
+ end
103
+
104
+ if attributes.has_key?(:'htmlIntro')
105
+ self.html_intro = attributes[:'htmlIntro']
106
+ end
107
+
108
+ if attributes.has_key?(:'imgUrl')
109
+ self.img_url = attributes[:'imgUrl']
110
+ end
111
+
112
+ if attributes.has_key?(:'itemCount')
113
+ self.item_count = attributes[:'itemCount']
114
+ end
115
+
116
+ if attributes.has_key?(:'renderAs')
117
+ self.render_as = attributes[:'renderAs']
118
+ end
119
+
120
+ if attributes.has_key?(:'visibleToAllUsers')
121
+ self.visible_to_all_users = attributes[:'visibleToAllUsers']
122
+ end
123
+
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properies with the reasons
128
+ def list_invalid_properties
129
+ invalid_properties = Array.new
130
+ return invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ return true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ progress == o.progress &&
145
+ id == o.id &&
146
+ name == o.name &&
147
+ html_intro == o.html_intro &&
148
+ img_url == o.img_url &&
149
+ item_count == o.item_count &&
150
+ render_as == o.render_as &&
151
+ visible_to_all_users == o.visible_to_all_users
152
+ end
153
+
154
+ # @see the `==` method
155
+ # @param [Object] Object to be compared
156
+ def eql?(o)
157
+ self == o
158
+ end
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Fixnum] Hash code
162
+ def hash
163
+ [progress, id, name, html_intro, img_url, item_count, render_as, visible_to_all_users].hash
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ self.class.swagger_types.each_pair do |key, type|
172
+ if type =~ /^Array<(.*)>/i
173
+ # check to ensure the input is an array given that the the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :DateTime
193
+ DateTime.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :BOOLEAN
203
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ temp_model = BombBomb.const_get(type).new
224
+ temp_model.build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ next if value.nil?
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map{ |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+
272
+ end