Class: Pingram::GetLogsResponseMessagesInner

Inherits:
ApiModelBase show all
Defined in:
lib/pingram/models/get_logs_response_messages_inner.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ GetLogsResponseMessagesInner

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 151

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::GetLogsResponseMessagesInner` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::GetLogsResponseMessagesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'tracking_id')
    self.tracking_id = attributes[:'tracking_id']
  else
    self.tracking_id = nil
  end

  if attributes.key?(:'event_type')
    self.event_type = attributes[:'event_type']
  else
    self.event_type = nil
  end

  if attributes.key?(:'timestamp')
    self.timestamp = attributes[:'timestamp']
  else
    self.timestamp = nil
  end

  if attributes.key?(:'epoch_ms')
    self.epoch_ms = attributes[:'epoch_ms']
  else
    self.epoch_ms = nil
  end

  if attributes.key?(:'inbox')
    self.inbox = attributes[:'inbox']
  end

  if attributes.key?(:'from')
    self.from = attributes[:'from']
  end

  if attributes.key?(:'from_name')
    self.from_name = attributes[:'from_name']
  end

  if attributes.key?(:'subject')
    self.subject = attributes[:'subject']
  end

  if attributes.key?(:'to')
    if (value = attributes[:'to']).is_a?(Array)
      self.to = value
    end
  end

  if attributes.key?(:'cc')
    if (value = attributes[:'cc']).is_a?(Array)
      self.cc = value
    end
  end

  if attributes.key?(:'bcc')
    if (value = attributes[:'bcc']).is_a?(Array)
      self.bcc = value
    end
  end

  if attributes.key?(:'reply_to')
    self.reply_to = attributes[:'reply_to']
  end

  if attributes.key?(:'body_text')
    self.body_text = attributes[:'body_text']
  end

  if attributes.key?(:'body_html')
    self.body_html = attributes[:'body_html']
  end

  if attributes.key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  end

  if attributes.key?(:'media')
    if (value = attributes[:'media']).is_a?(Array)
      self.media = value
    end
  end

  if attributes.key?(:'message_id')
    self.message_id = attributes[:'message_id']
  end

  if attributes.key?(:'in_reply_to')
    self.in_reply_to = attributes[:'in_reply_to']
  end

  if attributes.key?(:'references')
    self.references = attributes[:'references']
  end

  if attributes.key?(:'resolution_type')
    self.resolution_type = attributes[:'resolution_type']
  end
end

Instance Attribute Details

#attachmentsObject

Returns the value of attribute attachments.



46
47
48
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 46

def attachments
  @attachments
end

#bccObject

Returns the value of attribute bcc.



38
39
40
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 38

def bcc
  @bcc
end

#body_htmlObject

Returns the value of attribute body_html.



44
45
46
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 44

def body_html
  @body_html
end

#body_textObject

Returns the value of attribute body_text.



42
43
44
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 42

def body_text
  @body_text
end

#ccObject

Returns the value of attribute cc.



36
37
38
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 36

def cc
  @cc
end

#epoch_msObject

Returns the value of attribute epoch_ms.



24
25
26
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 24

def epoch_ms
  @epoch_ms
end

#event_typeObject

Returns the value of attribute event_type.



20
21
22
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 20

def event_type
  @event_type
end

#fromObject

Returns the value of attribute from.



28
29
30
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 28

def from
  @from
end

#from_nameObject

Returns the value of attribute from_name.



30
31
32
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 30

def from_name
  @from_name
end

#in_reply_toObject

Returns the value of attribute in_reply_to.



53
54
55
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 53

def in_reply_to
  @in_reply_to
end

#inboxObject

Returns the value of attribute inbox.



26
27
28
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 26

def inbox
  @inbox
end

#mediaObject

Inbound MMS attachments (includes contentType when available).



49
50
51
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 49

def media
  @media
end

#message_idObject

Returns the value of attribute message_id.



51
52
53
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 51

def message_id
  @message_id
end

#referencesObject

Returns the value of attribute references.



55
56
57
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 55

def references
  @references
end

#reply_toObject

Returns the value of attribute reply_to.



40
41
42
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 40

def reply_to
  @reply_to
end

#resolution_typeObject

Returns the value of attribute resolution_type.



57
58
59
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 57

def resolution_type
  @resolution_type
end

#subjectObject

Returns the value of attribute subject.



32
33
34
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 32

def subject
  @subject
end

#timestampObject

Returns the value of attribute timestamp.



22
23
24
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 22

def timestamp
  @timestamp
end

#toObject

Returns the value of attribute to.



34
35
36
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 34

def to
  @to
end

#tracking_idObject

Returns the value of attribute tracking_id.



18
19
20
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 18

def tracking_id
  @tracking_id
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



108
109
110
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 108

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



113
114
115
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 113

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 82

def self.attribute_map
  {
    :'tracking_id' => :'trackingId',
    :'event_type' => :'eventType',
    :'timestamp' => :'timestamp',
    :'epoch_ms' => :'epochMs',
    :'inbox' => :'inbox',
    :'from' => :'from',
    :'from_name' => :'fromName',
    :'subject' => :'subject',
    :'to' => :'to',
    :'cc' => :'cc',
    :'bcc' => :'bcc',
    :'reply_to' => :'replyTo',
    :'body_text' => :'bodyText',
    :'body_html' => :'bodyHtml',
    :'attachments' => :'attachments',
    :'media' => :'media',
    :'message_id' => :'messageId',
    :'in_reply_to' => :'inReplyTo',
    :'references' => :'references',
    :'resolution_type' => :'resolutionType'
  }
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



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 393

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



144
145
146
147
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 144

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 118

def self.openapi_types
  {
    :'tracking_id' => :'String',
    :'event_type' => :'String',
    :'timestamp' => :'String',
    :'epoch_ms' => :'Float',
    :'inbox' => :'String',
    :'from' => :'String',
    :'from_name' => :'String',
    :'subject' => :'String',
    :'to' => :'Array<String>',
    :'cc' => :'Array<String>',
    :'bcc' => :'Array<String>',
    :'reply_to' => :'String',
    :'body_text' => :'String',
    :'body_html' => :'String',
    :'attachments' => :'Array<GetLogsResponseMessagesInnerAttachmentsInner>',
    :'media' => :'Array<GetLogsResponseMessagesInnerMediaInner>',
    :'message_id' => :'String',
    :'in_reply_to' => :'String',
    :'references' => :'String',
    :'resolution_type' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 353

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      tracking_id == o.tracking_id &&
      event_type == o.event_type &&
      timestamp == o.timestamp &&
      epoch_ms == o.epoch_ms &&
      inbox == o.inbox &&
      from == o.from &&
      from_name == o.from_name &&
      subject == o.subject &&
      to == o.to &&
      cc == o.cc &&
      bcc == o.bcc &&
      reply_to == o.reply_to &&
      body_text == o.body_text &&
      body_html == o.body_html &&
      attachments == o.attachments &&
      media == o.media &&
      message_id == o.message_id &&
      in_reply_to == o.in_reply_to &&
      references == o.references &&
      resolution_type == o.resolution_type
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


380
381
382
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 380

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



386
387
388
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 386

def hash
  [tracking_id, event_type, timestamp, epoch_ms, inbox, from, from_name, subject, to, cc, bcc, reply_to, body_text, body_html, attachments, media, message_id, in_reply_to, references, resolution_type].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 266

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @tracking_id.nil?
    invalid_properties.push('invalid value for "tracking_id", tracking_id cannot be nil.')
  end

  if @event_type.nil?
    invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
  end

  if @timestamp.nil?
    invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
  end

  if @epoch_ms.nil?
    invalid_properties.push('invalid value for "epoch_ms", epoch_ms cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 415

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



290
291
292
293
294
295
296
297
298
299
# File 'lib/pingram/models/get_logs_response_messages_inner.rb', line 290

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @tracking_id.nil?
  return false if @event_type.nil?
  return false if @timestamp.nil?
  return false if @epoch_ms.nil?
  resolution_type_validator = EnumAttributeValidator.new('String', ["reply", "builtin", "custom", "inbound"])
  return false unless resolution_type_validator.valid?(@resolution_type)
  true
end