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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
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
# File 'lib/bombbomb/models/video_email_prompt.rb', line 193

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?(:'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?(:'contactId')
    self.contact_id = attributes[:'contactId']
  end

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

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

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

  if attributes.has_key?(:'followupVideoId')
    self.followup_video_id = attributes[:'followupVideoId']
  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?(:'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?(:'promptBotId')
    self.prompt_bot_id = attributes[:'promptBotId']
  end

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

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

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

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

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

  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?(:'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?(:'scheduledSendDate')
    self.scheduled_send_date = attributes[:'scheduledSendDate']
  end

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

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

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

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

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

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

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

end

Instance Attribute Details

#alternate_content_idObject

The id for the alternate content id



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

def alternate_content_id
  @alternate_content_id
end

#apply_templateObject

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



61
62
63
# File 'lib/bombbomb/models/video_email_prompt.rb', line 61

def apply_template
  @apply_template
end

#client_group_idObject

The client group campaign that created the prompt.



94
95
96
# File 'lib/bombbomb/models/video_email_prompt.rb', line 94

def client_group_id
  @client_group_id
end

#contact_idObject

Contact Id to send the final email to



28
29
30
# File 'lib/bombbomb/models/video_email_prompt.rb', line 28

def contact_id
  @contact_id
end

#created_dateObject

When the email was first sent out



103
104
105
# File 'lib/bombbomb/models/video_email_prompt.rb', line 103

def created_date
  @created_date
end

#email_contentObject

The HTML content of the final email



25
26
27
# File 'lib/bombbomb/models/video_email_prompt.rb', line 25

def email_content
  @email_content
end

#email_idObject

The email that was created by the prompt Read Only.



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

def email_id
  @email_id
end

#email_subject_lineObject

The subject line of the final email



22
23
24
# File 'lib/bombbomb/models/video_email_prompt.rb', line 22

def email_subject_line
  @email_subject_line
end

#example_video_idObject

An example or explanatory video to help the user understand what to say.



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

def example_video_id
  @example_video_id
end

#facebook_messageObject

The facebook message to be passed off to social sender



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

def facebook_message
  @facebook_message
end

#followup_video_idObject

An example or explanatory video to help the user understand what to say.



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

def followup_video_id
  @followup_video_id
end

#idObject

The identifier of the prompt. Read Only.



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

def id
  @id
end

#jericho_idObject

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



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

def jericho_id
  @jericho_id
end

#job_idObject

The job sent by the prompt Read Only.



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

def job_id
  @job_id
end

#last_notifiedObject

When the user was last notified about a prompt email waiting for a video



106
107
108
# File 'lib/bombbomb/models/video_email_prompt.rb', line 106

def last_notified
  @last_notified
end

#linkedin_messageObject

The linkedin message to be passed off to social sender



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

def linkedin_message
  @linkedin_message
end

#prompt_bot_idObject

The bot that created the prompt.



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

def prompt_bot_id
  @prompt_bot_id
end

#prompt_htmlObject

The suggested script of the prompt.



88
89
90
# File 'lib/bombbomb/models/video_email_prompt.rb', line 88

def prompt_html
  @prompt_html
end

#prompt_introObject

A paragraph intro statement about the purpose of the email you’re recording a video for.



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

def prompt_intro
  @prompt_intro
end

#prompt_subjectObject

The prompt’s subject line



85
86
87
# File 'lib/bombbomb/models/video_email_prompt.rb', line 85

def prompt_subject
  @prompt_subject
end

#scheduled_send_dateObject

When the final email is scheduled to be sent



91
92
93
# File 'lib/bombbomb/models/video_email_prompt.rb', line 91

def scheduled_send_date
  @scheduled_send_date
end

#send_mechanismObject

The sendMechanism property



109
110
111
# File 'lib/bombbomb/models/video_email_prompt.rb', line 109

def send_mechanism
  @send_mechanism
end

#send_typesObject

The types of mechanisms this prompt can send.



112
113
114
# File 'lib/bombbomb/models/video_email_prompt.rb', line 112

def send_types
  @send_types
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.



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

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



100
101
102
# File 'lib/bombbomb/models/video_email_prompt.rb', line 100

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.



19
20
21
# File 'lib/bombbomb/models/video_email_prompt.rb', line 19

def template_id
  @template_id
end

#thumbnail_urlObject

The URL of a thumbnail image for this prompt



97
98
99
# File 'lib/bombbomb/models/video_email_prompt.rb', line 97

def thumbnail_url
  @thumbnail_url
end

#to_listsObject

List Ids to send the final email to



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

def to_lists
  @to_lists
end

#twitter_messageObject

The twitter message to be passed off to social sender



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

def twitter_message
  @twitter_message
end

#user_idObject

The prompt’s owner. Read Only.



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

def user_id
  @user_id
end

#video_due_dateObject

When the video must be recorded by



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

def video_due_date
  @video_due_date
end

#video_idObject

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



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

def video_id
  @video_id
end

Class Method Details

.attribute_mapObject

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



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/bombbomb/models/video_email_prompt.rb', line 116

def self.attribute_map
  {
    :'template_id' => :'templateId',
    :'email_subject_line' => :'emailSubjectLine',
    :'email_content' => :'emailContent',
    :'contact_id' => :'contactId',
    :'to_lists' => :'toLists',
    :'prompt_intro' => :'promptIntro',
    :'example_video_id' => :'exampleVideoId',
    :'followup_video_id' => :'followupVideoId',
    :'send_without_video' => :'sendWithoutVideo',
    :'video_due_date' => :'videoDueDate',
    :'video_id' => :'videoId',
    :'email_id' => :'emailId',
    :'job_id' => :'jobId',
    :'prompt_bot_id' => :'promptBotId',
    :'apply_template' => :'applyTemplate',
    :'facebook_message' => :'facebookMessage',
    :'twitter_message' => :'twitterMessage',
    :'linkedin_message' => :'linkedinMessage',
    :'alternate_content_id' => :'alternateContentId',
    :'id' => :'id',
    :'user_id' => :'userId',
    :'jericho_id' => :'jerichoId',
    :'prompt_subject' => :'promptSubject',
    :'prompt_html' => :'promptHtml',
    :'scheduled_send_date' => :'scheduledSendDate',
    :'client_group_id' => :'clientGroupId',
    :'thumbnail_url' => :'thumbnailUrl',
    :'status' => :'status',
    :'created_date' => :'createdDate',
    :'last_notified' => :'lastNotified',
    :'send_mechanism' => :'sendMechanism',
    :'send_types' => :'sendTypes'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'template_id' => :'String',
    :'email_subject_line' => :'String',
    :'email_content' => :'String',
    :'contact_id' => :'String',
    :'to_lists' => :'Array<String>',
    :'prompt_intro' => :'String',
    :'example_video_id' => :'String',
    :'followup_video_id' => :'String',
    :'send_without_video' => :'BOOLEAN',
    :'video_due_date' => :'DateTime',
    :'video_id' => :'String',
    :'email_id' => :'String',
    :'job_id' => :'String',
    :'prompt_bot_id' => :'String',
    :'apply_template' => :'BOOLEAN',
    :'facebook_message' => :'String',
    :'twitter_message' => :'String',
    :'linkedin_message' => :'String',
    :'alternate_content_id' => :'String',
    :'id' => :'String',
    :'user_id' => :'String',
    :'jericho_id' => :'String',
    :'prompt_subject' => :'String',
    :'prompt_html' => :'String',
    :'scheduled_send_date' => :'DateTime',
    :'client_group_id' => :'String',
    :'thumbnail_url' => :'String',
    :'status' => :'Integer',
    :'created_date' => :'DateTime',
    :'last_notified' => :'DateTime',
    :'send_mechanism' => :'DateTime',
    :'send_types' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/bombbomb/models/video_email_prompt.rb', line 348

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      template_id == o.template_id &&
      email_subject_line == o.email_subject_line &&
      email_content == o.email_content &&
      contact_id == o.contact_id &&
      to_lists == o.to_lists &&
      prompt_intro == o.prompt_intro &&
      example_video_id == o.example_video_id &&
      followup_video_id == o.followup_video_id &&
      send_without_video == o.send_without_video &&
      video_due_date == o.video_due_date &&
      video_id == o.video_id &&
      email_id == o.email_id &&
      job_id == o.job_id &&
      prompt_bot_id == o.prompt_bot_id &&
      apply_template == o.apply_template &&
      facebook_message == o.facebook_message &&
      twitter_message == o.twitter_message &&
      linkedin_message == o.linkedin_message &&
      alternate_content_id == o.alternate_content_id &&
      id == o.id &&
      user_id == o.user_id &&
      jericho_id == o.jericho_id &&
      prompt_subject == o.prompt_subject &&
      prompt_html == o.prompt_html &&
      scheduled_send_date == o.scheduled_send_date &&
      client_group_id == o.client_group_id &&
      thumbnail_url == o.thumbnail_url &&
      status == o.status &&
      created_date == o.created_date &&
      last_notified == o.last_notified &&
      send_mechanism == o.send_mechanism &&
      send_types == o.send_types
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



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/bombbomb/models/video_email_prompt.rb', line 421

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 =~ /\A(true|t|yes|y|1)\z/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



487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/bombbomb/models/video_email_prompt.rb', line 487

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



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/bombbomb/models/video_email_prompt.rb', line 400

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/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


387
388
389
# File 'lib/bombbomb/models/video_email_prompt.rb', line 387

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



393
394
395
# File 'lib/bombbomb/models/video_email_prompt.rb', line 393

def hash
  [template_id, email_subject_line, email_content, contact_id, to_lists, prompt_intro, example_video_id, followup_video_id, send_without_video, video_due_date, video_id, email_id, job_id, prompt_bot_id, apply_template, facebook_message, twitter_message, linkedin_message, alternate_content_id, id, user_id, jericho_id, prompt_subject, prompt_html, scheduled_send_date, client_group_id, thumbnail_url, status, created_date, last_notified, send_mechanism, send_types].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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



467
468
469
# File 'lib/bombbomb/models/video_email_prompt.rb', line 467

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



473
474
475
476
477
478
479
480
481
# File 'lib/bombbomb/models/video_email_prompt.rb', line 473

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



461
462
463
# File 'lib/bombbomb/models/video_email_prompt.rb', line 461

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



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

def valid?
  return true
end