sendmux-mailbox 1.4.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +60 -1
  4. data/lib/sendmux/mailbox/version.rb +1 -1
  5. data/lib/sendmux_mailbox_generated/api/mailbox_api_api.rb +6 -6
  6. data/lib/sendmux_mailbox_generated/models/mailbox_identity_cursor_list_response.rb +1 -1
  7. data/lib/sendmux_mailbox_generated/models/mailbox_identity_list_meta.rb +173 -0
  8. data/lib/sendmux_mailbox_generated/models/mailbox_me.rb +14 -21
  9. data/lib/sendmux_mailbox_generated/models/mailbox_message.rb +29 -35
  10. data/lib/sendmux_mailbox_generated/models/mailbox_message_summary_cursor_list_response.rb +1 -1
  11. data/lib/sendmux_mailbox_generated/models/mailbox_query_meta.rb +173 -0
  12. data/lib/sendmux_mailbox_generated/models/mailbox_quota_cursor_list_response.rb +1 -1
  13. data/lib/sendmux_mailbox_generated/models/mailbox_realtime_message.rb +43 -49
  14. data/lib/sendmux_mailbox_generated/models/{mailbox_realtime_message_all_of_body.rb → mailbox_realtime_message_body.rb} +3 -3
  15. data/lib/sendmux_mailbox_generated/models/mailbox_submission_cursor_list_response.rb +1 -1
  16. data/lib/sendmux_mailbox_generated/models/mailbox_sync_meta.rb +173 -0
  17. data/lib/sendmux_mailbox_generated/models/mailbox_thread.rb +32 -39
  18. data/lib/sendmux_mailbox_generated/models/{mailbox.rb → mailbox_thread_message_summary_cursor_list_response.rb} +73 -106
  19. data/lib/sendmux_mailbox_generated/models/mailbox_thread_messages_meta.rb +199 -0
  20. data/lib/sendmux_mailbox_generated/models/mailbox_thread_summary_cursor_list_response.rb +1 -1
  21. data/lib/sendmux_mailbox_generated.rb +12 -2
  22. metadata +8 -4
@@ -0,0 +1,173 @@
1
+ =begin
2
+ #Sendmux API
3
+
4
+ #Programmatic access to your Sendmux email infrastructure.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Mailbox::Generated
17
+ class MailboxQueryMeta < ApiModelBase
18
+ attr_accessor :query_state
19
+
20
+ attr_accessor :request_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'query_state' => :'query_state',
26
+ :'request_id' => :'request_id'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'query_state' => :'String',
44
+ :'request_id' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxQueryMeta` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxQueryMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'query_state')
71
+ self.query_state = attributes[:'query_state']
72
+ end
73
+
74
+ if attributes.key?(:'request_id')
75
+ self.request_id = attributes[:'request_id']
76
+ else
77
+ self.request_id = nil
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @request_id.nil?
87
+ invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @request_id.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] request_id Value to be assigned
103
+ def request_id=(request_id)
104
+ if request_id.nil?
105
+ fail ArgumentError, 'request_id cannot be nil'
106
+ end
107
+
108
+ @request_id = request_id
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ query_state == o.query_state &&
117
+ request_id == o.request_id
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [query_state, request_id].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end
@@ -46,7 +46,7 @@ module Sendmux::Mailbox::Generated
46
46
  # Attribute type mapping.
47
47
  def self.openapi_types
48
48
  {
49
- :'meta' => :'ResponseMeta',
49
+ :'meta' => :'MailboxQueryMeta',
50
50
  :'ok' => :'Boolean',
51
51
  :'data' => :'Array<MailboxQuota>',
52
52
  :'pagination' => :'CursorPagination'
@@ -15,10 +15,13 @@ require 'time'
15
15
 
16
16
  module Sendmux::Mailbox::Generated
17
17
  class MailboxRealtimeMessage < ApiModelBase
18
+ # Attachment metadata for this message. Each item includes a short-lived `download_url`; if it expires, fetch message metadata again.
18
19
  attr_accessor :attachments
19
20
 
20
21
  attr_accessor :bcc
21
22
 
23
+ attr_accessor :body
24
+
22
25
  attr_accessor :cc
23
26
 
24
27
  attr_accessor :flags
@@ -39,6 +42,8 @@ module Sendmux::Mailbox::Generated
39
42
 
40
43
  attr_accessor :received_at
41
44
 
45
+ attr_accessor :rfc5322_message_id
46
+
42
47
  attr_accessor :sent_at
43
48
 
44
49
  attr_accessor :size_bytes
@@ -49,15 +54,12 @@ module Sendmux::Mailbox::Generated
49
54
 
50
55
  attr_accessor :to
51
56
 
52
- attr_accessor :body
53
-
54
- attr_accessor :rfc5322_message_id
55
-
56
57
  # Attribute mapping from ruby-style variable name to JSON key.
57
58
  def self.attribute_map
58
59
  {
59
60
  :'attachments' => :'attachments',
60
61
  :'bcc' => :'bcc',
62
+ :'body' => :'body',
61
63
  :'cc' => :'cc',
62
64
  :'flags' => :'flags',
63
65
  :'folder_ids' => :'folder_ids',
@@ -67,13 +69,12 @@ module Sendmux::Mailbox::Generated
67
69
  :'keywords' => :'keywords',
68
70
  :'preview' => :'preview',
69
71
  :'received_at' => :'received_at',
72
+ :'rfc5322_message_id' => :'rfc5322_message_id',
70
73
  :'sent_at' => :'sent_at',
71
74
  :'size_bytes' => :'size_bytes',
72
75
  :'subject' => :'subject',
73
76
  :'thread_id' => :'thread_id',
74
- :'to' => :'to',
75
- :'body' => :'body',
76
- :'rfc5322_message_id' => :'rfc5322_message_id'
77
+ :'to' => :'to'
77
78
  }
78
79
  end
79
80
 
@@ -92,6 +93,7 @@ module Sendmux::Mailbox::Generated
92
93
  {
93
94
  :'attachments' => :'Array<MailboxAttachment>',
94
95
  :'bcc' => :'Array<MailboxAddress>',
96
+ :'body' => :'MailboxRealtimeMessageBody',
95
97
  :'cc' => :'Array<MailboxAddress>',
96
98
  :'flags' => :'MailboxMessageFlags',
97
99
  :'folder_ids' => :'Array<String>',
@@ -101,13 +103,12 @@ module Sendmux::Mailbox::Generated
101
103
  :'keywords' => :'Array<String>',
102
104
  :'preview' => :'String',
103
105
  :'received_at' => :'String',
106
+ :'rfc5322_message_id' => :'String',
104
107
  :'sent_at' => :'String',
105
108
  :'size_bytes' => :'Integer',
106
109
  :'subject' => :'String',
107
110
  :'thread_id' => :'String',
108
- :'to' => :'Array<MailboxAddress>',
109
- :'body' => :'MailboxRealtimeMessageAllOfBody',
110
- :'rfc5322_message_id' => :'String'
111
+ :'to' => :'Array<MailboxAddress>'
111
112
  }
112
113
  end
113
114
 
@@ -117,21 +118,14 @@ module Sendmux::Mailbox::Generated
117
118
  :'from',
118
119
  :'preview',
119
120
  :'received_at',
121
+ :'rfc5322_message_id',
120
122
  :'sent_at',
121
123
  :'size_bytes',
122
124
  :'subject',
123
125
  :'thread_id',
124
- :'rfc5322_message_id'
125
126
  ])
126
127
  end
127
128
 
128
- # List of class defined in allOf (OpenAPI v3)
129
- def self.openapi_all_of
130
- [
131
- :'MailboxMessageSummary'
132
- ]
133
- end
134
-
135
129
  # Initializes the object
136
130
  # @param [Hash] attributes Model attributes in the form of hash
137
131
  def initialize(attributes = {})
@@ -162,6 +156,12 @@ module Sendmux::Mailbox::Generated
162
156
  self.bcc = nil
163
157
  end
164
158
 
159
+ if attributes.key?(:'body')
160
+ self.body = attributes[:'body']
161
+ else
162
+ self.body = nil
163
+ end
164
+
165
165
  if attributes.key?(:'cc')
166
166
  if (value = attributes[:'cc']).is_a?(Array)
167
167
  self.cc = value
@@ -222,6 +222,12 @@ module Sendmux::Mailbox::Generated
222
222
  self.received_at = nil
223
223
  end
224
224
 
225
+ if attributes.key?(:'rfc5322_message_id')
226
+ self.rfc5322_message_id = attributes[:'rfc5322_message_id']
227
+ else
228
+ self.rfc5322_message_id = nil
229
+ end
230
+
225
231
  if attributes.key?(:'sent_at')
226
232
  self.sent_at = attributes[:'sent_at']
227
233
  else
@@ -253,18 +259,6 @@ module Sendmux::Mailbox::Generated
253
259
  else
254
260
  self.to = nil
255
261
  end
256
-
257
- if attributes.key?(:'body')
258
- self.body = attributes[:'body']
259
- else
260
- self.body = nil
261
- end
262
-
263
- if attributes.key?(:'rfc5322_message_id')
264
- self.rfc5322_message_id = attributes[:'rfc5322_message_id']
265
- else
266
- self.rfc5322_message_id = nil
267
- end
268
262
  end
269
263
 
270
264
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -276,6 +270,10 @@ module Sendmux::Mailbox::Generated
276
270
  invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
277
271
  end
278
272
 
273
+ if @body.nil?
274
+ invalid_properties.push('invalid value for "body", body cannot be nil.')
275
+ end
276
+
279
277
  if @cc.nil?
280
278
  invalid_properties.push('invalid value for "cc", cc cannot be nil.')
281
279
  end
@@ -304,10 +302,6 @@ module Sendmux::Mailbox::Generated
304
302
  invalid_properties.push('invalid value for "to", to cannot be nil.')
305
303
  end
306
304
 
307
- if @body.nil?
308
- invalid_properties.push('invalid value for "body", body cannot be nil.')
309
- end
310
-
311
305
  invalid_properties
312
306
  end
313
307
 
@@ -316,6 +310,7 @@ module Sendmux::Mailbox::Generated
316
310
  def valid?
317
311
  warn '[DEPRECATED] the `valid?` method is obsolete'
318
312
  return false if @bcc.nil?
313
+ return false if @body.nil?
319
314
  return false if @cc.nil?
320
315
  return false if @flags.nil?
321
316
  return false if @folder_ids.nil?
@@ -323,7 +318,6 @@ module Sendmux::Mailbox::Generated
323
318
  return false if @id.nil?
324
319
  return false if @keywords.nil?
325
320
  return false if @to.nil?
326
- return false if @body.nil?
327
321
  true
328
322
  end
329
323
 
@@ -337,6 +331,16 @@ module Sendmux::Mailbox::Generated
337
331
  @bcc = bcc
338
332
  end
339
333
 
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] body Value to be assigned
336
+ def body=(body)
337
+ if body.nil?
338
+ fail ArgumentError, 'body cannot be nil'
339
+ end
340
+
341
+ @body = body
342
+ end
343
+
340
344
  # Custom attribute writer method with validation
341
345
  # @param [Object] cc Value to be assigned
342
346
  def cc=(cc)
@@ -407,16 +411,6 @@ module Sendmux::Mailbox::Generated
407
411
  @to = to
408
412
  end
409
413
 
410
- # Custom attribute writer method with validation
411
- # @param [Object] body Value to be assigned
412
- def body=(body)
413
- if body.nil?
414
- fail ArgumentError, 'body cannot be nil'
415
- end
416
-
417
- @body = body
418
- end
419
-
420
414
  # Checks equality by comparing each attribute.
421
415
  # @param [Object] Object to be compared
422
416
  def ==(o)
@@ -424,6 +418,7 @@ module Sendmux::Mailbox::Generated
424
418
  self.class == o.class &&
425
419
  attachments == o.attachments &&
426
420
  bcc == o.bcc &&
421
+ body == o.body &&
427
422
  cc == o.cc &&
428
423
  flags == o.flags &&
429
424
  folder_ids == o.folder_ids &&
@@ -433,13 +428,12 @@ module Sendmux::Mailbox::Generated
433
428
  keywords == o.keywords &&
434
429
  preview == o.preview &&
435
430
  received_at == o.received_at &&
431
+ rfc5322_message_id == o.rfc5322_message_id &&
436
432
  sent_at == o.sent_at &&
437
433
  size_bytes == o.size_bytes &&
438
434
  subject == o.subject &&
439
435
  thread_id == o.thread_id &&
440
- to == o.to &&
441
- body == o.body &&
442
- rfc5322_message_id == o.rfc5322_message_id
436
+ to == o.to
443
437
  end
444
438
 
445
439
  # @see the `==` method
@@ -451,7 +445,7 @@ module Sendmux::Mailbox::Generated
451
445
  # Calculates hash code according to all attributes.
452
446
  # @return [Integer] Hash code
453
447
  def hash
454
- [attachments, bcc, cc, flags, folder_ids, from, has_attachments, id, keywords, preview, received_at, sent_at, size_bytes, subject, thread_id, to, body, rfc5322_message_id].hash
448
+ [attachments, bcc, body, cc, flags, folder_ids, from, has_attachments, id, keywords, preview, received_at, rfc5322_message_id, sent_at, size_bytes, subject, thread_id, to].hash
455
449
  end
456
450
 
457
451
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Sendmux::Mailbox::Generated
17
- class MailboxRealtimeMessageAllOfBody < ApiModelBase
17
+ class MailboxRealtimeMessageBody < ApiModelBase
18
18
  attr_accessor :html
19
19
 
20
20
  attr_accessor :is_truncated
@@ -65,14 +65,14 @@ module Sendmux::Mailbox::Generated
65
65
  # @param [Hash] attributes Model attributes in the form of hash
66
66
  def initialize(attributes = {})
67
67
  if (!attributes.is_a?(Hash))
68
- fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxRealtimeMessageAllOfBody` initialize method"
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxRealtimeMessageBody` initialize method"
69
69
  end
70
70
 
71
71
  # check to see if the attribute exists and convert string to symbol for hash key
72
72
  acceptable_attribute_map = self.class.acceptable_attribute_map
73
73
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
74
  if (!acceptable_attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxRealtimeMessageAllOfBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxRealtimeMessageBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
76
  end
77
77
  h[k.to_sym] = v
78
78
  }
@@ -46,7 +46,7 @@ module Sendmux::Mailbox::Generated
46
46
  # Attribute type mapping.
47
47
  def self.openapi_types
48
48
  {
49
- :'meta' => :'ResponseMeta',
49
+ :'meta' => :'MailboxQueryMeta',
50
50
  :'ok' => :'Boolean',
51
51
  :'data' => :'Array<MailboxSubmission>',
52
52
  :'pagination' => :'CursorPagination'
@@ -0,0 +1,173 @@
1
+ =begin
2
+ #Sendmux API
3
+
4
+ #Programmatic access to your Sendmux email infrastructure.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Mailbox::Generated
17
+ class MailboxSyncMeta < ApiModelBase
18
+ attr_accessor :request_id
19
+
20
+ attr_accessor :sync_state
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'request_id' => :'request_id',
26
+ :'sync_state' => :'sync_state'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'request_id' => :'String',
44
+ :'sync_state' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Mailbox::Generated::MailboxSyncMeta` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Mailbox::Generated::MailboxSyncMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'request_id')
71
+ self.request_id = attributes[:'request_id']
72
+ else
73
+ self.request_id = nil
74
+ end
75
+
76
+ if attributes.key?(:'sync_state')
77
+ self.sync_state = attributes[:'sync_state']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @request_id.nil?
87
+ invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @request_id.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] request_id Value to be assigned
103
+ def request_id=(request_id)
104
+ if request_id.nil?
105
+ fail ArgumentError, 'request_id cannot be nil'
106
+ end
107
+
108
+ @request_id = request_id
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ request_id == o.request_id &&
117
+ sync_state == o.sync_state
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [request_id, sync_state].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end