Class: BombBomb::VideoEmailPrompt

Inherits:
Object
  • Object
show all
Defined in:
lib/bombbomb/models/video_email_prompt.rb

Overview

Configures a single prompt which asks a user to record a video into an outgoing email.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VideoEmailPrompt

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/bombbomb/models/video_email_prompt.rb', line 134

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'userId')
    self.user_id = attributes[:'userId']
  end

  if attributes.has_key?(:'templateId')
    self.template_id = attributes[:'templateId']
  end

  if attributes.has_key?(:'emailSubjectLine')
    self.email_subject_line = attributes[:'emailSubjectLine']
  end

  if attributes.has_key?(:'emailContent')
    self.email_content = attributes[:'emailContent']
  end

  if attributes.has_key?(:'toEmailAddresses')
    if (value = attributes[:'toEmailAddresses']).is_a?(Array)
      self.to_email_addresses = value
    end
  end

  if attributes.has_key?(:'toLists')
    if (value = attributes[:'toLists']).is_a?(Array)
      self.to_lists = value
    end
  end

  if attributes.has_key?(:'jerichoId')
    self.jericho_id = attributes[:'jerichoId']
  end

  if attributes.has_key?(:'promptSubject')
    self.prompt_subject = attributes[:'promptSubject']
  end

  if attributes.has_key?(:'promptHtml')
    self.prompt_html = attributes[:'promptHtml']
  end

  if attributes.has_key?(:'sendWithoutVideo')
    self.send_without_video = attributes[:'sendWithoutVideo']
  end

  if attributes.has_key?(:'videoDueDate')
    self.video_due_date = attributes[:'videoDueDate']
  end

  if attributes.has_key?(:'scheduledSendDate')
    self.scheduled_send_date = attributes[:'scheduledSendDate']
  end

  if attributes.has_key?(:'videoId')
    self.video_id = attributes[:'videoId']
  end

  if attributes.has_key?(:'emailId')
    self.email_id = attributes[:'emailId']
  end

  if attributes.has_key?(:'jobId')
    self.job_id = attributes[:'jobId']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'doNotApplyTemplate')
    self.do_not_apply_template = attributes[:'doNotApplyTemplate']
  end

end

Instance Attribute Details

#do_not_apply_templateObject

Controls whether a user template is applied to the message as it is sent



81
82
83
# File 'lib/bombbomb/models/video_email_prompt.rb', line 81

def do_not_apply_template
  @do_not_apply_template
end

#email_contentObject

The HTML content of the final email



42
43
44
# File 'lib/bombbomb/models/video_email_prompt.rb', line 42

def email_content
  @email_content
end

#email_idObject

The email that was created by the prompt Read Only.



72
73
74
# File 'lib/bombbomb/models/video_email_prompt.rb', line 72

def email_id
  @email_id
end

#email_subject_lineObject

The subject line of the final email



39
40
41
# File 'lib/bombbomb/models/video_email_prompt.rb', line 39

def email_subject_line
  @email_subject_line
end

#idObject

The identifier of the prompt. Read Only.



30
31
32
# File 'lib/bombbomb/models/video_email_prompt.rb', line 30

def id
  @id
end

#jericho_idObject

If sent in a jericho context, this will have the jericho id



51
52
53
# File 'lib/bombbomb/models/video_email_prompt.rb', line 51

def jericho_id
  @jericho_id
end

#job_idObject

The job sent by the prompt Read Only.



75
76
77
# File 'lib/bombbomb/models/video_email_prompt.rb', line 75

def job_id
  @job_id
end

#prompt_htmlObject

The HTML body of the prompt



57
58
59
# File 'lib/bombbomb/models/video_email_prompt.rb', line 57

def prompt_html
  @prompt_html
end

#prompt_subjectObject

The prompt’s subject line



54
55
56
# File 'lib/bombbomb/models/video_email_prompt.rb', line 54

def prompt_subject
  @prompt_subject
end

#scheduled_send_dateObject

When the final email is scheduled to be sent



66
67
68
# File 'lib/bombbomb/models/video_email_prompt.rb', line 66

def scheduled_send_date
  @scheduled_send_date
end

#send_without_videoObject

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
61
62
# File 'lib/bombbomb/models/video_email_prompt.rb', line 60

def send_without_video
  @send_without_video
end

#statusObject

The status of the prompt: created = 0, sent = 10, recorded = 20, job_created = 30, timed_out = 40, declined = 50 Read Only



78
79
80
# File 'lib/bombbomb/models/video_email_prompt.rb', line 78

def status
  @status
end

#template_idObject

Optional. The email template to be used in the sent email, if none supplied, the users’ default will be applied.



36
37
38
# File 'lib/bombbomb/models/video_email_prompt.rb', line 36

def template_id
  @template_id
end

#to_email_addressesObject

Email addresses to send the final email to, can be mixed with listIds.



45
46
47
# File 'lib/bombbomb/models/video_email_prompt.rb', line 45

def to_email_addresses
  @to_email_addresses
end

#to_listsObject

List Ids to send the final email to



48
49
50
# File 'lib/bombbomb/models/video_email_prompt.rb', line 48

def to_lists
  @to_lists
end

#user_idObject

The prompt’s owner. Read Only.



33
34
35
# File 'lib/bombbomb/models/video_email_prompt.rb', line 33

def user_id
  @user_id
end

#video_due_dateObject

When the video must be recorded by



63
64
65
# File 'lib/bombbomb/models/video_email_prompt.rb', line 63

def video_due_date
  @video_due_date
end

#video_idObject

The video that was added to the prompt. Read Only.



69
70
71
# File 'lib/bombbomb/models/video_email_prompt.rb', line 69

def video_id
  @video_id
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/bombbomb/models/video_email_prompt.rb', line 85

def self.attribute_map
  {
    :'id' => :'id',
    :'user_id' => :'userId',
    :'template_id' => :'templateId',
    :'email_subject_line' => :'emailSubjectLine',
    :'email_content' => :'emailContent',
    :'to_email_addresses' => :'toEmailAddresses',
    :'to_lists' => :'toLists',
    :'jericho_id' => :'jerichoId',
    :'prompt_subject' => :'promptSubject',
    :'prompt_html' => :'promptHtml',
    :'send_without_video' => :'sendWithoutVideo',
    :'video_due_date' => :'videoDueDate',
    :'scheduled_send_date' => :'scheduledSendDate',
    :'video_id' => :'videoId',
    :'email_id' => :'emailId',
    :'job_id' => :'jobId',
    :'status' => :'status',
    :'do_not_apply_template' => :'doNotApplyTemplate'
  }
end

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/bombbomb/models/video_email_prompt.rb', line 109

def self.swagger_types
  {
    :'id' => :'String',
    :'user_id' => :'String',
    :'template_id' => :'String',
    :'email_subject_line' => :'String',
    :'email_content' => :'String',
    :'to_email_addresses' => :'Array<String>',
    :'to_lists' => :'Array<String>',
    :'jericho_id' => :'String',
    :'prompt_subject' => :'String',
    :'prompt_html' => :'String',
    :'send_without_video' => :'BOOLEAN',
    :'video_due_date' => :'DateTime',
    :'scheduled_send_date' => :'DateTime',
    :'video_id' => :'String',
    :'email_id' => :'String',
    :'job_id' => :'String',
    :'status' => :'Integer',
    :'do_not_apply_template' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/bombbomb/models/video_email_prompt.rb', line 238

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      user_id == o.user_id &&
      template_id == o.template_id &&
      email_subject_line == o.email_subject_line &&
      email_content == o.email_content &&
      to_email_addresses == o.to_email_addresses &&
      to_lists == o.to_lists &&
      jericho_id == o.jericho_id &&
      prompt_subject == o.prompt_subject &&
      prompt_html == o.prompt_html &&
      send_without_video == o.send_without_video &&
      video_due_date == o.video_due_date &&
      scheduled_send_date == o.scheduled_send_date &&
      video_id == o.video_id &&
      email_id == o.email_id &&
      job_id == o.job_id &&
      status == o.status &&
      do_not_apply_template == o.do_not_apply_template
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/bombbomb/models/video_email_prompt.rb', line 297

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = BombBomb.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/bombbomb/models/video_email_prompt.rb', line 363

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/bombbomb/models/video_email_prompt.rb', line 276

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


263
264
265
# File 'lib/bombbomb/models/video_email_prompt.rb', line 263

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



269
270
271
# File 'lib/bombbomb/models/video_email_prompt.rb', line 269

def hash
  [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
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



220
221
222
223
# File 'lib/bombbomb/models/video_email_prompt.rb', line 220

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



343
344
345
# File 'lib/bombbomb/models/video_email_prompt.rb', line 343

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



349
350
351
352
353
354
355
356
357
# File 'lib/bombbomb/models/video_email_prompt.rb', line 349

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



337
338
339
# File 'lib/bombbomb/models/video_email_prompt.rb', line 337

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



227
228
229
230
231
232
233
234
# File 'lib/bombbomb/models/video_email_prompt.rb', line 227

def valid?
  return false if @email_subject_line.nil?
  return false if @email_content.nil?
  return false if @prompt_subject.nil?
  return false if @prompt_html.nil?
  return false if @scheduled_send_date.nil?
  return true
end