bombbomb 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE +201 -0
  3. data/README.md +139 -0
  4. data/Rakefile +3 -0
  5. data/bombbomb.gemspec +55 -0
  6. data/docs/BBWebHook.md +11 -0
  7. data/docs/InlineResponse200.md +9 -0
  8. data/docs/InlineResponse200Items.md +11 -0
  9. data/docs/JerichoConfiguration.md +18 -0
  10. data/docs/JerichoPerformance.md +18 -0
  11. data/docs/OAuthClient.md +13 -0
  12. data/docs/PromptsApi.md +169 -0
  13. data/docs/String.md +7 -0
  14. data/docs/TeamsApi.md +290 -0
  15. data/docs/UtilitiesApi.md +204 -0
  16. data/docs/VideoEmailPrompt.md +25 -0
  17. data/docs/WebhooksApi.md +207 -0
  18. data/git_push.sh +67 -0
  19. data/lib/bombbomb.rb +62 -0
  20. data/lib/bombbomb/api/prompts_api.rb +217 -0
  21. data/lib/bombbomb/api/teams_api.rb +346 -0
  22. data/lib/bombbomb/api/utilities_api.rb +258 -0
  23. data/lib/bombbomb/api/webhooks_api.rb +254 -0
  24. data/lib/bombbomb/api_client.rb +379 -0
  25. data/lib/bombbomb/api_error.rb +47 -0
  26. data/lib/bombbomb/configuration.rb +214 -0
  27. data/lib/bombbomb/models/bb_web_hook.rb +230 -0
  28. data/lib/bombbomb/models/inline_response_200.rb +210 -0
  29. data/lib/bombbomb/models/inline_response_200_items.rb +226 -0
  30. data/lib/bombbomb/models/jericho_configuration.rb +299 -0
  31. data/lib/bombbomb/models/jericho_performance.rb +300 -0
  32. data/lib/bombbomb/models/o_auth_client.rb +250 -0
  33. data/lib/bombbomb/models/string.rb +190 -0
  34. data/lib/bombbomb/models/video_email_prompt.rb +379 -0
  35. data/lib/bombbomb/version.rb +26 -0
  36. data/spec/api/prompts_api_spec.rb +84 -0
  37. data/spec/api/teams_api_spec.rb +113 -0
  38. data/spec/api/utilities_api_spec.rb +93 -0
  39. data/spec/api/webhooks_api_spec.rb +92 -0
  40. data/spec/api_client_spec.rb +237 -0
  41. data/spec/configuration_spec.rb +53 -0
  42. data/spec/models/bb_web_hook_spec.rb +71 -0
  43. data/spec/models/inline_response_200_items_spec.rb +71 -0
  44. data/spec/models/inline_response_200_spec.rb +59 -0
  45. data/spec/models/jericho_configuration_spec.rb +113 -0
  46. data/spec/models/jericho_performance_spec.rb +113 -0
  47. data/spec/models/o_auth_client_spec.rb +83 -0
  48. data/spec/models/string_spec.rb +47 -0
  49. data/spec/models/video_email_prompt_spec.rb +155 -0
  50. data/spec/spec_helper.rb +122 -0
  51. metadata +288 -0
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #BombBomb
3
+
4
+ #We make it easy to build relationships using simple videos.
5
+
6
+ OpenAPI spec version: 2.0
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
+
28
+ class OAuthClient
29
+ # The id of the OAuth Client
30
+ attr_accessor :identifier
31
+
32
+ # The user-facing name of the client. Eg. MyCrm
33
+ attr_accessor :name
34
+
35
+ # The secret supplied to the OAuth Application
36
+ attr_accessor :client_secret
37
+
38
+ # The grants allowed
39
+ attr_accessor :grants_allowed
40
+
41
+ # The user who controls the OAuth App
42
+ attr_accessor :owning_user_id
43
+
44
+ # Where OAuth authorization sessions are returned to
45
+ attr_accessor :redirect_uri
46
+
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'identifier' => :'identifier',
52
+ :'name' => :'name',
53
+ :'client_secret' => :'clientSecret',
54
+ :'grants_allowed' => :'grantsAllowed',
55
+ :'owning_user_id' => :'owningUserId',
56
+ :'redirect_uri' => :'redirectUri'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'identifier' => :'String',
64
+ :'name' => :'String',
65
+ :'client_secret' => :'String',
66
+ :'grants_allowed' => :'String',
67
+ :'owning_user_id' => :'String',
68
+ :'redirect_uri' => :'String'
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
79
+
80
+ if attributes.has_key?(:'identifier')
81
+ self.identifier = attributes[:'identifier']
82
+ end
83
+
84
+ if attributes.has_key?(:'name')
85
+ self.name = attributes[:'name']
86
+ end
87
+
88
+ if attributes.has_key?(:'clientSecret')
89
+ self.client_secret = attributes[:'clientSecret']
90
+ end
91
+
92
+ if attributes.has_key?(:'grantsAllowed')
93
+ self.grants_allowed = attributes[:'grantsAllowed']
94
+ end
95
+
96
+ if attributes.has_key?(:'owningUserId')
97
+ self.owning_user_id = attributes[:'owningUserId']
98
+ end
99
+
100
+ if attributes.has_key?(:'redirectUri')
101
+ self.redirect_uri = attributes[:'redirectUri']
102
+ end
103
+
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properies with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ return invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ identifier == o.identifier &&
125
+ name == o.name &&
126
+ client_secret == o.client_secret &&
127
+ grants_allowed == o.grants_allowed &&
128
+ owning_user_id == o.owning_user_id &&
129
+ redirect_uri == o.redirect_uri
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Fixnum] Hash code
140
+ def hash
141
+ [identifier, name, client_secret, grants_allowed, owning_user_id, redirect_uri].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ self.class.swagger_types.each_pair do |key, type|
150
+ if type =~ /^Array<(.*)>/i
151
+ # check to ensure the input is an array given that the the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :DateTime
171
+ DateTime.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :BOOLEAN
181
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ temp_model = BombBomb.const_get(type).new
202
+ temp_model.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ next if value.nil?
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map{ |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #BombBomb
3
+
4
+ #We make it easy to build relationships using simple videos.
5
+
6
+ OpenAPI spec version: 2.0
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
+
28
+ class String
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ }
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ return unless attributes.is_a?(Hash)
46
+
47
+ # convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
49
+
50
+ end
51
+
52
+ # Show invalid properties with the reasons. Usually used together with valid?
53
+ # @return Array for valid properies with the reasons
54
+ def list_invalid_properties
55
+ invalid_properties = Array.new
56
+ return invalid_properties
57
+ end
58
+
59
+ # Check to see if the all the properties in the model are valid
60
+ # @return true if the model is valid
61
+ def valid?
62
+ return true
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class
70
+ end
71
+
72
+ # @see the `==` method
73
+ # @param [Object] Object to be compared
74
+ def eql?(o)
75
+ self == o
76
+ end
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [].hash
82
+ end
83
+
84
+ # Builds the object from hash
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @return [Object] Returns the model itself
87
+ def build_from_hash(attributes)
88
+ return nil unless attributes.is_a?(Hash)
89
+ self.class.swagger_types.each_pair do |key, type|
90
+ if type =~ /^Array<(.*)>/i
91
+ # check to ensure the input is an array given that the the attribute
92
+ # is documented as an array but the input is not
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ end
96
+ elsif !attributes[self.class.attribute_map[key]].nil?
97
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ # Deserializes the data based on type
105
+ # @param string type Data type
106
+ # @param string value Value to be deserialized
107
+ # @return [Object] Deserialized data
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ temp_model = BombBomb.const_get(type).new
142
+ temp_model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # to_body is an alias to to_hash (backward compatibility)
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_body
155
+ to_hash
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map{ |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -0,0 +1,379 @@
1
+ =begin
2
+ #BombBomb
3
+
4
+ #We make it easy to build relationships using simple videos.
5
+
6
+ OpenAPI spec version: 2.0
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
+ # Configures a single prompt which asks a user to record a video into an outgoing email.
28
+ class VideoEmailPrompt
29
+ # The identifier of the prompt. Read Only.
30
+ attr_accessor :id
31
+
32
+ # The prompt's owner. Read Only.
33
+ attr_accessor :user_id
34
+
35
+ # Optional. The email template to be used in the sent email, if none supplied, the users' default will be applied.
36
+ attr_accessor :template_id
37
+
38
+ # The subject line of the final email
39
+ attr_accessor :email_subject_line
40
+
41
+ # The HTML content of the final email
42
+ attr_accessor :email_content
43
+
44
+ # Email addresses to send the final email to, can be mixed with listIds.
45
+ attr_accessor :to_email_addresses
46
+
47
+ # List Ids to send the final email to
48
+ attr_accessor :to_lists
49
+
50
+ # If sent in a jericho context, this will have the jericho id
51
+ attr_accessor :jericho_id
52
+
53
+ # The prompt's subject line
54
+ attr_accessor :prompt_subject
55
+
56
+ # The HTML body of the prompt
57
+ attr_accessor :prompt_html
58
+
59
+ # Whether to send the email if no video is recorded. If set to require a video, and none is added before the videoDueDate, the prompt is cancelled.
60
+ attr_accessor :send_without_video
61
+
62
+ # When the video must be recorded by
63
+ attr_accessor :video_due_date
64
+
65
+ # When the final email is scheduled to be sent
66
+ attr_accessor :scheduled_send_date
67
+
68
+ # The video that was added to the prompt. Read Only.
69
+ attr_accessor :video_id
70
+
71
+ # The email that was created by the prompt Read Only.
72
+ attr_accessor :email_id
73
+
74
+ # The job sent by the prompt Read Only.
75
+ attr_accessor :job_id
76
+
77
+ # The status of the prompt: created = 0, sent = 10, recorded = 20, job_created = 30, timed_out = 40, declined = 50 Read Only
78
+ attr_accessor :status
79
+
80
+ # Controls whether a user template is applied to the message as it is sent
81
+ attr_accessor :do_not_apply_template
82
+
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'id' => :'id',
88
+ :'user_id' => :'userId',
89
+ :'template_id' => :'templateId',
90
+ :'email_subject_line' => :'emailSubjectLine',
91
+ :'email_content' => :'emailContent',
92
+ :'to_email_addresses' => :'toEmailAddresses',
93
+ :'to_lists' => :'toLists',
94
+ :'jericho_id' => :'jerichoId',
95
+ :'prompt_subject' => :'promptSubject',
96
+ :'prompt_html' => :'promptHtml',
97
+ :'send_without_video' => :'sendWithoutVideo',
98
+ :'video_due_date' => :'videoDueDate',
99
+ :'scheduled_send_date' => :'scheduledSendDate',
100
+ :'video_id' => :'videoId',
101
+ :'email_id' => :'emailId',
102
+ :'job_id' => :'jobId',
103
+ :'status' => :'status',
104
+ :'do_not_apply_template' => :'doNotApplyTemplate'
105
+ }
106
+ end
107
+
108
+ # Attribute type mapping.
109
+ def self.swagger_types
110
+ {
111
+ :'id' => :'String',
112
+ :'user_id' => :'String',
113
+ :'template_id' => :'String',
114
+ :'email_subject_line' => :'String',
115
+ :'email_content' => :'String',
116
+ :'to_email_addresses' => :'Array<String>',
117
+ :'to_lists' => :'Array<String>',
118
+ :'jericho_id' => :'String',
119
+ :'prompt_subject' => :'String',
120
+ :'prompt_html' => :'String',
121
+ :'send_without_video' => :'BOOLEAN',
122
+ :'video_due_date' => :'DateTime',
123
+ :'scheduled_send_date' => :'DateTime',
124
+ :'video_id' => :'String',
125
+ :'email_id' => :'String',
126
+ :'job_id' => :'String',
127
+ :'status' => :'Integer',
128
+ :'do_not_apply_template' => :'BOOLEAN'
129
+ }
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ return unless attributes.is_a?(Hash)
136
+
137
+ # convert string to symbol for hash key
138
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
139
+
140
+ if attributes.has_key?(:'id')
141
+ self.id = attributes[:'id']
142
+ end
143
+
144
+ if attributes.has_key?(:'userId')
145
+ self.user_id = attributes[:'userId']
146
+ end
147
+
148
+ if attributes.has_key?(:'templateId')
149
+ self.template_id = attributes[:'templateId']
150
+ end
151
+
152
+ if attributes.has_key?(:'emailSubjectLine')
153
+ self.email_subject_line = attributes[:'emailSubjectLine']
154
+ end
155
+
156
+ if attributes.has_key?(:'emailContent')
157
+ self.email_content = attributes[:'emailContent']
158
+ end
159
+
160
+ if attributes.has_key?(:'toEmailAddresses')
161
+ if (value = attributes[:'toEmailAddresses']).is_a?(Array)
162
+ self.to_email_addresses = value
163
+ end
164
+ end
165
+
166
+ if attributes.has_key?(:'toLists')
167
+ if (value = attributes[:'toLists']).is_a?(Array)
168
+ self.to_lists = value
169
+ end
170
+ end
171
+
172
+ if attributes.has_key?(:'jerichoId')
173
+ self.jericho_id = attributes[:'jerichoId']
174
+ end
175
+
176
+ if attributes.has_key?(:'promptSubject')
177
+ self.prompt_subject = attributes[:'promptSubject']
178
+ end
179
+
180
+ if attributes.has_key?(:'promptHtml')
181
+ self.prompt_html = attributes[:'promptHtml']
182
+ end
183
+
184
+ if attributes.has_key?(:'sendWithoutVideo')
185
+ self.send_without_video = attributes[:'sendWithoutVideo']
186
+ end
187
+
188
+ if attributes.has_key?(:'videoDueDate')
189
+ self.video_due_date = attributes[:'videoDueDate']
190
+ end
191
+
192
+ if attributes.has_key?(:'scheduledSendDate')
193
+ self.scheduled_send_date = attributes[:'scheduledSendDate']
194
+ end
195
+
196
+ if attributes.has_key?(:'videoId')
197
+ self.video_id = attributes[:'videoId']
198
+ end
199
+
200
+ if attributes.has_key?(:'emailId')
201
+ self.email_id = attributes[:'emailId']
202
+ end
203
+
204
+ if attributes.has_key?(:'jobId')
205
+ self.job_id = attributes[:'jobId']
206
+ end
207
+
208
+ if attributes.has_key?(:'status')
209
+ self.status = attributes[:'status']
210
+ end
211
+
212
+ if attributes.has_key?(:'doNotApplyTemplate')
213
+ self.do_not_apply_template = attributes[:'doNotApplyTemplate']
214
+ end
215
+
216
+ end
217
+
218
+ # Show invalid properties with the reasons. Usually used together with valid?
219
+ # @return Array for valid properies with the reasons
220
+ def list_invalid_properties
221
+ invalid_properties = Array.new
222
+ return invalid_properties
223
+ end
224
+
225
+ # Check to see if the all the properties in the model are valid
226
+ # @return true if the model is valid
227
+ def valid?
228
+ return false if @email_subject_line.nil?
229
+ return false if @email_content.nil?
230
+ return false if @prompt_subject.nil?
231
+ return false if @prompt_html.nil?
232
+ return false if @scheduled_send_date.nil?
233
+ return true
234
+ end
235
+
236
+ # Checks equality by comparing each attribute.
237
+ # @param [Object] Object to be compared
238
+ def ==(o)
239
+ return true if self.equal?(o)
240
+ self.class == o.class &&
241
+ id == o.id &&
242
+ user_id == o.user_id &&
243
+ template_id == o.template_id &&
244
+ email_subject_line == o.email_subject_line &&
245
+ email_content == o.email_content &&
246
+ to_email_addresses == o.to_email_addresses &&
247
+ to_lists == o.to_lists &&
248
+ jericho_id == o.jericho_id &&
249
+ prompt_subject == o.prompt_subject &&
250
+ prompt_html == o.prompt_html &&
251
+ send_without_video == o.send_without_video &&
252
+ video_due_date == o.video_due_date &&
253
+ scheduled_send_date == o.scheduled_send_date &&
254
+ video_id == o.video_id &&
255
+ email_id == o.email_id &&
256
+ job_id == o.job_id &&
257
+ status == o.status &&
258
+ do_not_apply_template == o.do_not_apply_template
259
+ end
260
+
261
+ # @see the `==` method
262
+ # @param [Object] Object to be compared
263
+ def eql?(o)
264
+ self == o
265
+ end
266
+
267
+ # Calculates hash code according to all attributes.
268
+ # @return [Fixnum] Hash code
269
+ def hash
270
+ [id, user_id, template_id, email_subject_line, email_content, to_email_addresses, to_lists, jericho_id, prompt_subject, prompt_html, send_without_video, video_due_date, scheduled_send_date, video_id, email_id, job_id, status, do_not_apply_template].hash
271
+ end
272
+
273
+ # Builds the object from hash
274
+ # @param [Hash] attributes Model attributes in the form of hash
275
+ # @return [Object] Returns the model itself
276
+ def build_from_hash(attributes)
277
+ return nil unless attributes.is_a?(Hash)
278
+ self.class.swagger_types.each_pair do |key, type|
279
+ if type =~ /^Array<(.*)>/i
280
+ # check to ensure the input is an array given that the the attribute
281
+ # is documented as an array but the input is not
282
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
283
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
284
+ end
285
+ elsif !attributes[self.class.attribute_map[key]].nil?
286
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
287
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
288
+ end
289
+
290
+ self
291
+ end
292
+
293
+ # Deserializes the data based on type
294
+ # @param string type Data type
295
+ # @param string value Value to be deserialized
296
+ # @return [Object] Deserialized data
297
+ def _deserialize(type, value)
298
+ case type.to_sym
299
+ when :DateTime
300
+ DateTime.parse(value)
301
+ when :Date
302
+ Date.parse(value)
303
+ when :String
304
+ value.to_s
305
+ when :Integer
306
+ value.to_i
307
+ when :Float
308
+ value.to_f
309
+ when :BOOLEAN
310
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
311
+ true
312
+ else
313
+ false
314
+ end
315
+ when :Object
316
+ # generic object (usually a Hash), return directly
317
+ value
318
+ when /\AArray<(?<inner_type>.+)>\z/
319
+ inner_type = Regexp.last_match[:inner_type]
320
+ value.map { |v| _deserialize(inner_type, v) }
321
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
322
+ k_type = Regexp.last_match[:k_type]
323
+ v_type = Regexp.last_match[:v_type]
324
+ {}.tap do |hash|
325
+ value.each do |k, v|
326
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
327
+ end
328
+ end
329
+ else # model
330
+ temp_model = BombBomb.const_get(type).new
331
+ temp_model.build_from_hash(value)
332
+ end
333
+ end
334
+
335
+ # Returns the string representation of the object
336
+ # @return [String] String presentation of the object
337
+ def to_s
338
+ to_hash.to_s
339
+ end
340
+
341
+ # to_body is an alias to to_hash (backward compatibility)
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_body
344
+ to_hash
345
+ end
346
+
347
+ # Returns the object in the form of hash
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_hash
350
+ hash = {}
351
+ self.class.attribute_map.each_pair do |attr, param|
352
+ value = self.send(attr)
353
+ next if value.nil?
354
+ hash[param] = _to_hash(value)
355
+ end
356
+ hash
357
+ end
358
+
359
+ # Outputs non-array value in the form of hash
360
+ # For object, use to_hash. Otherwise, just return the value
361
+ # @param [Object] value Any valid value
362
+ # @return [Hash] Returns the value in the form of hash
363
+ def _to_hash(value)
364
+ if value.is_a?(Array)
365
+ value.compact.map{ |v| _to_hash(v) }
366
+ elsif value.is_a?(Hash)
367
+ {}.tap do |hash|
368
+ value.each { |k, v| hash[k] = _to_hash(v) }
369
+ end
370
+ elsif value.respond_to? :to_hash
371
+ value.to_hash
372
+ else
373
+ value
374
+ end
375
+ end
376
+
377
+ end
378
+
379
+ end