late-sdk 0.0.86 → 0.0.87

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/docs/WebhookEventsApi.md +766 -0
  4. data/docs/WebhookPayloadAccountConnected.md +5 -3
  5. data/docs/WebhookPayloadAccountConnectedAccount.md +4 -4
  6. data/docs/WebhookPayloadAccountDisconnected.md +5 -3
  7. data/docs/WebhookPayloadAccountDisconnectedAccount.md +6 -6
  8. data/docs/WebhookPayloadComment.md +7 -5
  9. data/docs/WebhookPayloadCommentAccount.md +3 -3
  10. data/docs/WebhookPayloadCommentComment.md +9 -9
  11. data/docs/WebhookPayloadCommentCommentAuthor.md +1 -1
  12. data/docs/WebhookPayloadCommentPost.md +2 -2
  13. data/docs/WebhookPayloadMessage.md +7 -5
  14. data/docs/WebhookPayloadMessageAccount.md +3 -3
  15. data/docs/WebhookPayloadMessageConversation.md +3 -5
  16. data/docs/WebhookPayloadMessageMessage.md +10 -10
  17. data/docs/WebhookPayloadMessageMessageAttachmentsInner.md +2 -2
  18. data/docs/WebhookPayloadMessageMessageSender.md +1 -1
  19. data/docs/WebhookPayloadPost.md +5 -3
  20. data/docs/WebhookPayloadPostPost.md +5 -5
  21. data/docs/WebhookPayloadPostPostPlatformsInner.md +4 -2
  22. data/docs/WebhookPayloadTest.md +24 -0
  23. data/lib/late-sdk/api/webhook_events_api.rb +748 -0
  24. data/lib/late-sdk/api/webhooks_api.rb +1 -1
  25. data/lib/late-sdk/models/webhook_log.rb +2 -2
  26. data/lib/late-sdk/models/webhook_payload_account_connected.rb +69 -1
  27. data/lib/late-sdk/models/webhook_payload_account_connected_account.rb +68 -0
  28. data/lib/late-sdk/models/webhook_payload_account_disconnected.rb +69 -1
  29. data/lib/late-sdk/models/webhook_payload_account_disconnected_account.rb +92 -0
  30. data/lib/late-sdk/models/webhook_payload_comment.rb +103 -1
  31. data/lib/late-sdk/models/webhook_payload_comment_account.rb +51 -0
  32. data/lib/late-sdk/models/webhook_payload_comment_comment.rb +143 -0
  33. data/lib/late-sdk/models/webhook_payload_comment_comment_author.rb +17 -0
  34. data/lib/late-sdk/models/webhook_payload_comment_post.rb +34 -0
  35. data/lib/late-sdk/models/webhook_payload_message.rb +104 -2
  36. data/lib/late-sdk/models/webhook_payload_message_account.rb +51 -0
  37. data/lib/late-sdk/models/webhook_payload_message_conversation.rb +39 -20
  38. data/lib/late-sdk/models/webhook_payload_message_message.rb +154 -4
  39. data/lib/late-sdk/models/webhook_payload_message_message_attachments_inner.rb +34 -0
  40. data/lib/late-sdk/models/webhook_payload_message_message_sender.rb +17 -0
  41. data/lib/late-sdk/models/webhook_payload_post.rb +71 -3
  42. data/lib/late-sdk/models/webhook_payload_post_post.rb +85 -0
  43. data/lib/late-sdk/models/webhook_payload_post_post_platforms_inner.rb +44 -1
  44. data/lib/late-sdk/models/webhook_payload_test.rb +269 -0
  45. data/lib/late-sdk/version.rb +1 -1
  46. data/lib/late-sdk.rb +1 -0
  47. data/openapi.yaml +236 -20
  48. data/spec/models/create_webhook_settings_request_spec.rb +1 -1
  49. data/spec/models/update_webhook_settings_request_spec.rb +1 -1
  50. data/spec/models/webhook_log_spec.rb +1 -1
  51. data/spec/models/webhook_payload_account_connected_spec.rb +6 -0
  52. data/spec/models/webhook_payload_account_disconnected_spec.rb +6 -0
  53. data/spec/models/webhook_payload_comment_spec.rb +6 -0
  54. data/spec/models/webhook_payload_message_conversation_spec.rb +0 -10
  55. data/spec/models/webhook_payload_message_message_spec.rb +2 -2
  56. data/spec/models/webhook_payload_message_spec.rb +6 -0
  57. data/spec/models/webhook_payload_post_post_platforms_inner_spec.rb +6 -0
  58. data/spec/models/webhook_payload_post_spec.rb +7 -1
  59. data/spec/models/webhook_payload_test_spec.rb +58 -0
  60. data/spec/models/webhook_spec.rb +1 -1
  61. data/zernio-sdk-0.0.87.gem +0 -0
  62. metadata +665 -659
  63. data/zernio-sdk-0.0.86.gem +0 -0
@@ -188,7 +188,7 @@ module Late
188
188
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
189
189
  fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
190
190
  end
191
- allowable_values = ["post.scheduled", "post.published", "post.failed", "post.partial", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"]
191
+ allowable_values = ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"]
192
192
  if @api_client.config.client_side_validation && opts[:'event'] && !allowable_values.include?(opts[:'event'])
193
193
  fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}"
194
194
  end
@@ -207,7 +207,7 @@ module Late
207
207
  # @return true if the model is valid
208
208
  def valid?
209
209
  warn '[DEPRECATED] the `valid?` method is obsolete'
210
- event_validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
210
+ event_validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
211
211
  return false unless event_validator.valid?(@event)
212
212
  status_validator = EnumAttributeValidator.new('String', ["success", "failed"])
213
213
  return false unless status_validator.valid?(@status)
@@ -217,7 +217,7 @@ module Late
217
217
  # Custom attribute writer method checking allowed values (enum).
218
218
  # @param [Object] event Object to be assigned
219
219
  def event=(event)
220
- validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
220
+ validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
221
221
  unless validator.valid?(event)
222
222
  fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
223
223
  end
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Late
17
17
  # Webhook payload for account connected events
18
18
  class WebhookPayloadAccountConnected < ApiModelBase
19
+ # Stable webhook event ID
20
+ attr_accessor :id
21
+
19
22
  attr_accessor :event
20
23
 
21
24
  attr_accessor :account
@@ -47,6 +50,7 @@ module Late
47
50
  # Attribute mapping from ruby-style variable name to JSON key.
48
51
  def self.attribute_map
49
52
  {
53
+ :'id' => :'id',
50
54
  :'event' => :'event',
51
55
  :'account' => :'account',
52
56
  :'timestamp' => :'timestamp'
@@ -66,6 +70,7 @@ module Late
66
70
  # Attribute type mapping.
67
71
  def self.openapi_types
68
72
  {
73
+ :'id' => :'String',
69
74
  :'event' => :'String',
70
75
  :'account' => :'WebhookPayloadAccountConnectedAccount',
71
76
  :'timestamp' => :'Time'
@@ -94,16 +99,28 @@ module Late
94
99
  h[k.to_sym] = v
95
100
  }
96
101
 
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ else
105
+ self.id = nil
106
+ end
107
+
97
108
  if attributes.key?(:'event')
98
109
  self.event = attributes[:'event']
110
+ else
111
+ self.event = nil
99
112
  end
100
113
 
101
114
  if attributes.key?(:'account')
102
115
  self.account = attributes[:'account']
116
+ else
117
+ self.account = nil
103
118
  end
104
119
 
105
120
  if attributes.key?(:'timestamp')
106
121
  self.timestamp = attributes[:'timestamp']
122
+ else
123
+ self.timestamp = nil
107
124
  end
108
125
  end
109
126
 
@@ -112,6 +129,22 @@ module Late
112
129
  def list_invalid_properties
113
130
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
131
  invalid_properties = Array.new
132
+ if @id.nil?
133
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
134
+ end
135
+
136
+ if @event.nil?
137
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
138
+ end
139
+
140
+ if @account.nil?
141
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
142
+ end
143
+
144
+ if @timestamp.nil?
145
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
146
+ end
147
+
115
148
  invalid_properties
116
149
  end
117
150
 
@@ -119,11 +152,25 @@ module Late
119
152
  # @return true if the model is valid
120
153
  def valid?
121
154
  warn '[DEPRECATED] the `valid?` method is obsolete'
155
+ return false if @id.nil?
156
+ return false if @event.nil?
122
157
  event_validator = EnumAttributeValidator.new('String', ["account.connected"])
123
158
  return false unless event_validator.valid?(@event)
159
+ return false if @account.nil?
160
+ return false if @timestamp.nil?
124
161
  true
125
162
  end
126
163
 
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] id Value to be assigned
166
+ def id=(id)
167
+ if id.nil?
168
+ fail ArgumentError, 'id cannot be nil'
169
+ end
170
+
171
+ @id = id
172
+ end
173
+
127
174
  # Custom attribute writer method checking allowed values (enum).
128
175
  # @param [Object] event Object to be assigned
129
176
  def event=(event)
@@ -134,11 +181,32 @@ module Late
134
181
  @event = event
135
182
  end
136
183
 
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] account Value to be assigned
186
+ def account=(account)
187
+ if account.nil?
188
+ fail ArgumentError, 'account cannot be nil'
189
+ end
190
+
191
+ @account = account
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] timestamp Value to be assigned
196
+ def timestamp=(timestamp)
197
+ if timestamp.nil?
198
+ fail ArgumentError, 'timestamp cannot be nil'
199
+ end
200
+
201
+ @timestamp = timestamp
202
+ end
203
+
137
204
  # Checks equality by comparing each attribute.
138
205
  # @param [Object] Object to be compared
139
206
  def ==(o)
140
207
  return true if self.equal?(o)
141
208
  self.class == o.class &&
209
+ id == o.id &&
142
210
  event == o.event &&
143
211
  account == o.account &&
144
212
  timestamp == o.timestamp
@@ -153,7 +221,7 @@ module Late
153
221
  # Calculates hash code according to all attributes.
154
222
  # @return [Integer] Hash code
155
223
  def hash
156
- [event, account, timestamp].hash
224
+ [id, event, account, timestamp].hash
157
225
  end
158
226
 
159
227
  # Builds the object from hash
@@ -83,18 +83,26 @@ module Late
83
83
 
84
84
  if attributes.key?(:'account_id')
85
85
  self.account_id = attributes[:'account_id']
86
+ else
87
+ self.account_id = nil
86
88
  end
87
89
 
88
90
  if attributes.key?(:'profile_id')
89
91
  self.profile_id = attributes[:'profile_id']
92
+ else
93
+ self.profile_id = nil
90
94
  end
91
95
 
92
96
  if attributes.key?(:'platform')
93
97
  self.platform = attributes[:'platform']
98
+ else
99
+ self.platform = nil
94
100
  end
95
101
 
96
102
  if attributes.key?(:'username')
97
103
  self.username = attributes[:'username']
104
+ else
105
+ self.username = nil
98
106
  end
99
107
 
100
108
  if attributes.key?(:'display_name')
@@ -107,6 +115,22 @@ module Late
107
115
  def list_invalid_properties
108
116
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
117
  invalid_properties = Array.new
118
+ if @account_id.nil?
119
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
120
+ end
121
+
122
+ if @profile_id.nil?
123
+ invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
124
+ end
125
+
126
+ if @platform.nil?
127
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
128
+ end
129
+
130
+ if @username.nil?
131
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
132
+ end
133
+
110
134
  invalid_properties
111
135
  end
112
136
 
@@ -114,9 +138,53 @@ module Late
114
138
  # @return true if the model is valid
115
139
  def valid?
116
140
  warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @account_id.nil?
142
+ return false if @profile_id.nil?
143
+ return false if @platform.nil?
144
+ return false if @username.nil?
117
145
  true
118
146
  end
119
147
 
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] account_id Value to be assigned
150
+ def account_id=(account_id)
151
+ if account_id.nil?
152
+ fail ArgumentError, 'account_id cannot be nil'
153
+ end
154
+
155
+ @account_id = account_id
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] profile_id Value to be assigned
160
+ def profile_id=(profile_id)
161
+ if profile_id.nil?
162
+ fail ArgumentError, 'profile_id cannot be nil'
163
+ end
164
+
165
+ @profile_id = profile_id
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] platform Value to be assigned
170
+ def platform=(platform)
171
+ if platform.nil?
172
+ fail ArgumentError, 'platform cannot be nil'
173
+ end
174
+
175
+ @platform = platform
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] username Value to be assigned
180
+ def username=(username)
181
+ if username.nil?
182
+ fail ArgumentError, 'username cannot be nil'
183
+ end
184
+
185
+ @username = username
186
+ end
187
+
120
188
  # Checks equality by comparing each attribute.
121
189
  # @param [Object] Object to be compared
122
190
  def ==(o)
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Late
17
17
  # Webhook payload for account disconnected events
18
18
  class WebhookPayloadAccountDisconnected < ApiModelBase
19
+ # Stable webhook event ID
20
+ attr_accessor :id
21
+
19
22
  attr_accessor :event
20
23
 
21
24
  attr_accessor :account
@@ -47,6 +50,7 @@ module Late
47
50
  # Attribute mapping from ruby-style variable name to JSON key.
48
51
  def self.attribute_map
49
52
  {
53
+ :'id' => :'id',
50
54
  :'event' => :'event',
51
55
  :'account' => :'account',
52
56
  :'timestamp' => :'timestamp'
@@ -66,6 +70,7 @@ module Late
66
70
  # Attribute type mapping.
67
71
  def self.openapi_types
68
72
  {
73
+ :'id' => :'String',
69
74
  :'event' => :'String',
70
75
  :'account' => :'WebhookPayloadAccountDisconnectedAccount',
71
76
  :'timestamp' => :'Time'
@@ -94,16 +99,28 @@ module Late
94
99
  h[k.to_sym] = v
95
100
  }
96
101
 
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ else
105
+ self.id = nil
106
+ end
107
+
97
108
  if attributes.key?(:'event')
98
109
  self.event = attributes[:'event']
110
+ else
111
+ self.event = nil
99
112
  end
100
113
 
101
114
  if attributes.key?(:'account')
102
115
  self.account = attributes[:'account']
116
+ else
117
+ self.account = nil
103
118
  end
104
119
 
105
120
  if attributes.key?(:'timestamp')
106
121
  self.timestamp = attributes[:'timestamp']
122
+ else
123
+ self.timestamp = nil
107
124
  end
108
125
  end
109
126
 
@@ -112,6 +129,22 @@ module Late
112
129
  def list_invalid_properties
113
130
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
131
  invalid_properties = Array.new
132
+ if @id.nil?
133
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
134
+ end
135
+
136
+ if @event.nil?
137
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
138
+ end
139
+
140
+ if @account.nil?
141
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
142
+ end
143
+
144
+ if @timestamp.nil?
145
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
146
+ end
147
+
115
148
  invalid_properties
116
149
  end
117
150
 
@@ -119,11 +152,25 @@ module Late
119
152
  # @return true if the model is valid
120
153
  def valid?
121
154
  warn '[DEPRECATED] the `valid?` method is obsolete'
155
+ return false if @id.nil?
156
+ return false if @event.nil?
122
157
  event_validator = EnumAttributeValidator.new('String', ["account.disconnected"])
123
158
  return false unless event_validator.valid?(@event)
159
+ return false if @account.nil?
160
+ return false if @timestamp.nil?
124
161
  true
125
162
  end
126
163
 
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] id Value to be assigned
166
+ def id=(id)
167
+ if id.nil?
168
+ fail ArgumentError, 'id cannot be nil'
169
+ end
170
+
171
+ @id = id
172
+ end
173
+
127
174
  # Custom attribute writer method checking allowed values (enum).
128
175
  # @param [Object] event Object to be assigned
129
176
  def event=(event)
@@ -134,11 +181,32 @@ module Late
134
181
  @event = event
135
182
  end
136
183
 
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] account Value to be assigned
186
+ def account=(account)
187
+ if account.nil?
188
+ fail ArgumentError, 'account cannot be nil'
189
+ end
190
+
191
+ @account = account
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] timestamp Value to be assigned
196
+ def timestamp=(timestamp)
197
+ if timestamp.nil?
198
+ fail ArgumentError, 'timestamp cannot be nil'
199
+ end
200
+
201
+ @timestamp = timestamp
202
+ end
203
+
137
204
  # Checks equality by comparing each attribute.
138
205
  # @param [Object] Object to be compared
139
206
  def ==(o)
140
207
  return true if self.equal?(o)
141
208
  self.class == o.class &&
209
+ id == o.id &&
142
210
  event == o.event &&
143
211
  account == o.account &&
144
212
  timestamp == o.timestamp
@@ -153,7 +221,7 @@ module Late
153
221
  # Calculates hash code according to all attributes.
154
222
  # @return [Integer] Hash code
155
223
  def hash
156
- [event, account, timestamp].hash
224
+ [id, event, account, timestamp].hash
157
225
  end
158
226
 
159
227
  # Builds the object from hash
@@ -115,18 +115,26 @@ module Late
115
115
 
116
116
  if attributes.key?(:'account_id')
117
117
  self.account_id = attributes[:'account_id']
118
+ else
119
+ self.account_id = nil
118
120
  end
119
121
 
120
122
  if attributes.key?(:'profile_id')
121
123
  self.profile_id = attributes[:'profile_id']
124
+ else
125
+ self.profile_id = nil
122
126
  end
123
127
 
124
128
  if attributes.key?(:'platform')
125
129
  self.platform = attributes[:'platform']
130
+ else
131
+ self.platform = nil
126
132
  end
127
133
 
128
134
  if attributes.key?(:'username')
129
135
  self.username = attributes[:'username']
136
+ else
137
+ self.username = nil
130
138
  end
131
139
 
132
140
  if attributes.key?(:'display_name')
@@ -135,10 +143,14 @@ module Late
135
143
 
136
144
  if attributes.key?(:'disconnection_type')
137
145
  self.disconnection_type = attributes[:'disconnection_type']
146
+ else
147
+ self.disconnection_type = nil
138
148
  end
139
149
 
140
150
  if attributes.key?(:'reason')
141
151
  self.reason = attributes[:'reason']
152
+ else
153
+ self.reason = nil
142
154
  end
143
155
  end
144
156
 
@@ -147,6 +159,30 @@ module Late
147
159
  def list_invalid_properties
148
160
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
149
161
  invalid_properties = Array.new
162
+ if @account_id.nil?
163
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
164
+ end
165
+
166
+ if @profile_id.nil?
167
+ invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
168
+ end
169
+
170
+ if @platform.nil?
171
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
172
+ end
173
+
174
+ if @username.nil?
175
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
176
+ end
177
+
178
+ if @disconnection_type.nil?
179
+ invalid_properties.push('invalid value for "disconnection_type", disconnection_type cannot be nil.')
180
+ end
181
+
182
+ if @reason.nil?
183
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
184
+ end
185
+
150
186
  invalid_properties
151
187
  end
152
188
 
@@ -154,11 +190,57 @@ module Late
154
190
  # @return true if the model is valid
155
191
  def valid?
156
192
  warn '[DEPRECATED] the `valid?` method is obsolete'
193
+ return false if @account_id.nil?
194
+ return false if @profile_id.nil?
195
+ return false if @platform.nil?
196
+ return false if @username.nil?
197
+ return false if @disconnection_type.nil?
157
198
  disconnection_type_validator = EnumAttributeValidator.new('String', ["intentional", "unintentional"])
158
199
  return false unless disconnection_type_validator.valid?(@disconnection_type)
200
+ return false if @reason.nil?
159
201
  true
160
202
  end
161
203
 
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] account_id Value to be assigned
206
+ def account_id=(account_id)
207
+ if account_id.nil?
208
+ fail ArgumentError, 'account_id cannot be nil'
209
+ end
210
+
211
+ @account_id = account_id
212
+ end
213
+
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] profile_id Value to be assigned
216
+ def profile_id=(profile_id)
217
+ if profile_id.nil?
218
+ fail ArgumentError, 'profile_id cannot be nil'
219
+ end
220
+
221
+ @profile_id = profile_id
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] platform Value to be assigned
226
+ def platform=(platform)
227
+ if platform.nil?
228
+ fail ArgumentError, 'platform cannot be nil'
229
+ end
230
+
231
+ @platform = platform
232
+ end
233
+
234
+ # Custom attribute writer method with validation
235
+ # @param [Object] username Value to be assigned
236
+ def username=(username)
237
+ if username.nil?
238
+ fail ArgumentError, 'username cannot be nil'
239
+ end
240
+
241
+ @username = username
242
+ end
243
+
162
244
  # Custom attribute writer method checking allowed values (enum).
163
245
  # @param [Object] disconnection_type Object to be assigned
164
246
  def disconnection_type=(disconnection_type)
@@ -169,6 +251,16 @@ module Late
169
251
  @disconnection_type = disconnection_type
170
252
  end
171
253
 
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] reason Value to be assigned
256
+ def reason=(reason)
257
+ if reason.nil?
258
+ fail ArgumentError, 'reason cannot be nil'
259
+ end
260
+
261
+ @reason = reason
262
+ end
263
+
172
264
  # Checks equality by comparing each attribute.
173
265
  # @param [Object] Object to be compared
174
266
  def ==(o)