Class: Lockally::MigrationMailbox

Inherits:
ApiModelBase show all
Defined in:
lib/lockally/models/migration_mailbox.rb

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 = {}) ⇒ MigrationMailbox

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/lockally/models/migration_mailbox.rb', line 124

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::MigrationMailbox` 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 `Lockally::MigrationMailbox`. 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?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#completed_atObject

Returns the value of attribute completed_at.



50
51
52
# File 'lib/lockally/models/migration_mailbox.rb', line 50

def completed_at
  @completed_at
end

#created_atObject

Returns the value of attribute created_at.



52
53
54
# File 'lib/lockally/models/migration_mailbox.rb', line 52

def created_at
  @created_at
end

#dest_emailObject

Returns the value of attribute dest_email.



26
27
28
# File 'lib/lockally/models/migration_mailbox.rb', line 26

def dest_email
  @dest_email
end

#dest_mailbox_idObject

Returns the value of attribute dest_mailbox_id.



28
29
30
# File 'lib/lockally/models/migration_mailbox.rb', line 28

def dest_mailbox_id
  @dest_mailbox_id
end

#error_messageObject

Returns the value of attribute error_message.



46
47
48
# File 'lib/lockally/models/migration_mailbox.rb', line 46

def error_message
  @error_message
end

#failed_message_countObject

Returns the value of attribute failed_message_count.



36
37
38
# File 'lib/lockally/models/migration_mailbox.rb', line 36

def failed_message_count
  @failed_message_count
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/lockally/models/migration_mailbox.rb', line 18

def id
  @id
end

#last_synced_atObject

Returns the value of attribute last_synced_at.



44
45
46
# File 'lib/lockally/models/migration_mailbox.rb', line 44

def last_synced_at
  @last_synced_at
end

#last_synced_uidObject

Returns the value of attribute last_synced_uid.



42
43
44
# File 'lib/lockally/models/migration_mailbox.rb', line 42

def last_synced_uid
  @last_synced_uid
end

#migration_idObject

Returns the value of attribute migration_id.



20
21
22
# File 'lib/lockally/models/migration_mailbox.rb', line 20

def migration_id
  @migration_id
end

#source_emailObject

Returns the value of attribute source_email.



24
25
26
# File 'lib/lockally/models/migration_mailbox.rb', line 24

def source_email
  @source_email
end

#source_message_countObject

Returns the value of attribute source_message_count.



32
33
34
# File 'lib/lockally/models/migration_mailbox.rb', line 32

def source_message_count
  @source_message_count
end

#source_size_bytesObject

Returns the value of attribute source_size_bytes.



38
39
40
# File 'lib/lockally/models/migration_mailbox.rb', line 38

def source_size_bytes
  @source_size_bytes
end

#started_atObject

Returns the value of attribute started_at.



48
49
50
# File 'lib/lockally/models/migration_mailbox.rb', line 48

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status.



30
31
32
# File 'lib/lockally/models/migration_mailbox.rb', line 30

def status
  @status
end

#synced_message_countObject

Returns the value of attribute synced_message_count.



34
35
36
# File 'lib/lockally/models/migration_mailbox.rb', line 34

def synced_message_count
  @synced_message_count
end

#synced_size_bytesObject

Returns the value of attribute synced_size_bytes.



40
41
42
# File 'lib/lockally/models/migration_mailbox.rb', line 40

def synced_size_bytes
  @synced_size_bytes
end

#tenant_idObject

Returns the value of attribute tenant_id.



22
23
24
# File 'lib/lockally/models/migration_mailbox.rb', line 22

def tenant_id
  @tenant_id
end

#updated_atObject

Returns the value of attribute updated_at.



54
55
56
# File 'lib/lockally/models/migration_mailbox.rb', line 54

def updated_at
  @updated_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



82
83
84
# File 'lib/lockally/models/migration_mailbox.rb', line 82

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



87
88
89
# File 'lib/lockally/models/migration_mailbox.rb', line 87

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/lockally/models/migration_mailbox.rb', line 57

def self.attribute_map
  {
    :'id' => :'id',
    :'migration_id' => :'migration_id',
    :'tenant_id' => :'tenant_id',
    :'source_email' => :'source_email',
    :'dest_email' => :'dest_email',
    :'dest_mailbox_id' => :'dest_mailbox_id',
    :'status' => :'status',
    :'source_message_count' => :'source_message_count',
    :'synced_message_count' => :'synced_message_count',
    :'failed_message_count' => :'failed_message_count',
    :'source_size_bytes' => :'source_size_bytes',
    :'synced_size_bytes' => :'synced_size_bytes',
    :'last_synced_uid' => :'last_synced_uid',
    :'last_synced_at' => :'last_synced_at',
    :'error_message' => :'error_message',
    :'started_at' => :'started_at',
    :'completed_at' => :'completed_at',
    :'created_at' => :'created_at',
    :'updated_at' => :'updated_at'
  }
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



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/lockally/models/migration_mailbox.rb', line 424

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



117
118
119
120
# File 'lib/lockally/models/migration_mailbox.rb', line 117

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

.openapi_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/lockally/models/migration_mailbox.rb', line 92

def self.openapi_types
  {
    :'id' => :'String',
    :'migration_id' => :'String',
    :'tenant_id' => :'String',
    :'source_email' => :'String',
    :'dest_email' => :'String',
    :'dest_mailbox_id' => :'String',
    :'status' => :'String',
    :'source_message_count' => :'Integer',
    :'synced_message_count' => :'Integer',
    :'failed_message_count' => :'Integer',
    :'source_size_bytes' => :'Integer',
    :'synced_size_bytes' => :'Integer',
    :'last_synced_uid' => :'String',
    :'last_synced_at' => :'Time',
    :'error_message' => :'String',
    :'started_at' => :'Time',
    :'completed_at' => :'Time',
    :'created_at' => :'Time',
    :'updated_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/lockally/models/migration_mailbox.rb', line 385

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      migration_id == o.migration_id &&
      tenant_id == o.tenant_id &&
      source_email == o.source_email &&
      dest_email == o.dest_email &&
      dest_mailbox_id == o.dest_mailbox_id &&
      status == o.status &&
      source_message_count == o.source_message_count &&
      synced_message_count == o.synced_message_count &&
      failed_message_count == o.failed_message_count &&
      source_size_bytes == o.source_size_bytes &&
      synced_size_bytes == o.synced_size_bytes &&
      last_synced_uid == o.last_synced_uid &&
      last_synced_at == o.last_synced_at &&
      error_message == o.error_message &&
      started_at == o.started_at &&
      completed_at == o.completed_at &&
      created_at == o.created_at &&
      updated_at == o.updated_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


411
412
413
# File 'lib/lockally/models/migration_mailbox.rb', line 411

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



417
418
419
# File 'lib/lockally/models/migration_mailbox.rb', line 417

def hash
  [id, migration_id, tenant_id, source_email, dest_email, dest_mailbox_id, status, source_message_count, synced_message_count, failed_message_count, source_size_bytes, synced_size_bytes, last_synced_uid, last_synced_at, error_message, started_at, completed_at, created_at, updated_at].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/lockally/models/migration_mailbox.rb', line 235

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

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

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

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

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

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

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

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

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at 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



446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/lockally/models/migration_mailbox.rb', line 446

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



279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/lockally/models/migration_mailbox.rb', line 279

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @migration_id.nil?
  return false if @tenant_id.nil?
  return false if @source_email.nil?
  return false if @status.nil?
  return false if @synced_message_count.nil?
  return false if @failed_message_count.nil?
  return false if @created_at.nil?
  return false if @updated_at.nil?
  true
end