Class: BombBomb::PromptSocialPrompt

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

Overview

The Prompt\SocialPrompt class

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PromptSocialPrompt

Initializes the object

Parameters:

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

    Model attributes in the form of hash



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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
152
153
154
155
156
157
158
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 98

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?(:'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

#client_group_idObject

The client group campaign that created the prompt.



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

def client_group_id
  @client_group_id
end

#created_dateObject

When the email was first sent out



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

def created_date
  @created_date
end

#idObject

The identifier of the prompt. Read Only.



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

def id
  @id
end

#jericho_idObject

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



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

def jericho_id
  @jericho_id
end

#last_notifiedObject

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



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

def last_notified
  @last_notified
end

#prompt_htmlObject

The suggested script of the prompt.



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

def prompt_html
  @prompt_html
end

#prompt_subjectObject

The prompt’s subject line



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

def prompt_subject
  @prompt_subject
end

#scheduled_send_dateObject

When the final email is scheduled to be sent



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

def scheduled_send_date
  @scheduled_send_date
end

#send_mechanismObject

The sendMechanism property



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

def send_mechanism
  @send_mechanism
end

#send_typesObject

The types of mechanisms this prompt can send.



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

def send_types
  @send_types
end

#statusObject

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



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

def status
  @status
end

#thumbnail_urlObject

The URL of a thumbnail image for this prompt



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

def thumbnail_url
  @thumbnail_url
end

#user_idObject

The prompt’s owner. Read Only.



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

def user_id
  @user_id
end

Class Method Details

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 59

def self.attribute_map
  {
    :'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.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 78

def self.swagger_types
  {
    :'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



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 175

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      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



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

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



295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 295

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



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 208

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


195
196
197
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 195

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



201
202
203
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 201

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



162
163
164
165
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 162

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



275
276
277
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 275

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



281
282
283
284
285
286
287
288
289
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 281

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



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

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



169
170
171
# File 'lib/bombbomb/models/prompt_social_prompt.rb', line 169

def valid?
  return true
end