lockally 0.3.1 → 0.3.3
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.
- checksums.yaml +4 -4
- data/README.md +7 -5
- data/docs/AdminApi.md +3 -3
- data/docs/AdminsApi.md +1 -1
- data/docs/AgentSendResult.md +6 -2
- data/docs/AgentsApi.md +2 -2
- data/docs/AiApi.md +1 -1
- data/docs/AliasesApi.md +1 -1
- data/docs/ApiKeysApi.md +3 -3
- data/docs/DomainsApi.md +3 -3
- data/docs/MailboxGrant.md +7 -3
- data/docs/MailboxGrantList.md +2 -2
- data/docs/MailboxesApi.md +6 -6
- data/docs/MarkReadResult.md +2 -0
- data/docs/SendApi.md +4 -4
- data/docs/SimulatedInbound.md +6 -0
- data/docs/TenantApi.md +1 -1
- data/docs/TestApi.md +1 -1
- data/docs/ThreadClassification.md +2 -0
- data/docs/ThreadMessageBody.md +10 -26
- data/docs/{ThreadMessageBodyAllOfBody.md → ThreadMessageBodyBody.md} +2 -2
- data/docs/WebhooksApi.md +3 -3
- data/docs/Whoami.md +7 -7
- data/docs/WhoamiKey.md +20 -0
- data/docs/WhoamiTenant.md +22 -0
- data/lib/lockally/api/admin_api.rb +6 -6
- data/lib/lockally/api/admins_api.rb +2 -2
- data/lib/lockally/api/agents_api.rb +4 -4
- data/lib/lockally/api/ai_api.rb +2 -2
- data/lib/lockally/api/aliases_api.rb +2 -2
- data/lib/lockally/api/api_keys_api.rb +6 -6
- data/lib/lockally/api/domains_api.rb +6 -6
- data/lib/lockally/api/mailboxes_api.rb +12 -12
- data/lib/lockally/api/send_api.rb +8 -8
- data/lib/lockally/api/tenant_api.rb +2 -2
- data/lib/lockally/api/test_api.rb +2 -2
- data/lib/lockally/api/webhooks_api.rb +6 -6
- data/lib/lockally/models/agent_send_result.rb +72 -1
- data/lib/lockally/models/mailbox_grant.rb +28 -10
- data/lib/lockally/models/mailbox_grant_list.rb +17 -17
- data/lib/lockally/models/mark_read_result.rb +10 -1
- data/lib/lockally/models/simulated_inbound.rb +29 -1
- data/lib/lockally/models/thread_classification.rb +11 -1
- data/lib/lockally/models/thread_message_body.rb +58 -233
- data/lib/lockally/models/{thread_message_body_all_of_body.rb → thread_message_body_body.rb} +4 -3
- data/lib/lockally/models/whoami.rb +98 -24
- data/lib/lockally/models/whoami_key.rb +157 -0
- data/lib/lockally/models/whoami_tenant.rb +166 -0
- data/lib/lockally/version.rb +1 -1
- data/lib/lockally.rb +3 -1
- data/spec/api/admin_api_spec.rb +3 -3
- data/spec/api/admins_api_spec.rb +1 -1
- data/spec/api/agents_api_spec.rb +2 -2
- data/spec/api/ai_api_spec.rb +1 -1
- data/spec/api/aliases_api_spec.rb +1 -1
- data/spec/api/api_keys_api_spec.rb +3 -3
- data/spec/api/domains_api_spec.rb +3 -3
- data/spec/api/mailboxes_api_spec.rb +6 -6
- data/spec/api/send_api_spec.rb +4 -4
- data/spec/api/tenant_api_spec.rb +1 -1
- data/spec/api/test_api_spec.rb +1 -1
- data/spec/api/webhooks_api_spec.rb +3 -3
- data/spec/models/agent_send_result_spec.rb +12 -0
- data/spec/models/mailbox_grant_list_spec.rb +1 -1
- data/spec/models/mailbox_grant_spec.rb +13 -1
- data/spec/models/mark_read_result_spec.rb +6 -0
- data/spec/models/simulated_inbound_spec.rb +18 -0
- data/spec/models/thread_classification_spec.rb +6 -0
- data/spec/models/{thread_message_body_all_of_body_spec.rb → thread_message_body_body_spec.rb} +6 -6
- data/spec/models/thread_message_body_spec.rb +5 -57
- data/spec/models/whoami_key_spec.rb +42 -0
- data/spec/models/whoami_spec.rb +8 -4
- data/spec/models/whoami_tenant_spec.rb +48 -0
- metadata +14 -6
|
@@ -15,71 +15,25 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Lockally
|
|
17
17
|
class ThreadMessageBody < ApiModelBase
|
|
18
|
-
attr_accessor :
|
|
18
|
+
attr_accessor :thread_id
|
|
19
19
|
|
|
20
|
-
attr_accessor :
|
|
20
|
+
attr_accessor :mailbox
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
attr_accessor :rfc_message_id
|
|
24
|
-
|
|
25
|
-
attr_accessor :in_reply_to
|
|
26
|
-
|
|
27
|
-
attr_accessor :subject
|
|
28
|
-
|
|
29
|
-
attr_accessor :from
|
|
30
|
-
|
|
31
|
-
attr_accessor :to
|
|
32
|
-
|
|
33
|
-
attr_accessor :snippet
|
|
34
|
-
|
|
35
|
-
attr_accessor :has_attachments
|
|
36
|
-
|
|
37
|
-
attr_accessor :attachments
|
|
38
|
-
|
|
39
|
-
attr_accessor :annotations
|
|
40
|
-
|
|
41
|
-
attr_accessor :received_at
|
|
22
|
+
attr_accessor :message
|
|
42
23
|
|
|
43
24
|
attr_accessor :body
|
|
44
25
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
attr_reader :allowable_values
|
|
48
|
-
|
|
49
|
-
def initialize(datatype, allowable_values)
|
|
50
|
-
@allowable_values = allowable_values.map do |value|
|
|
51
|
-
case datatype.to_s
|
|
52
|
-
when /Integer/i
|
|
53
|
-
value.to_i
|
|
54
|
-
when /Float/i
|
|
55
|
-
value.to_f
|
|
56
|
-
else
|
|
57
|
-
value
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def valid?(value)
|
|
63
|
-
!value || allowable_values.include?(value)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
26
|
+
# Present instead of body when the message could not be located in the mailbox.
|
|
27
|
+
attr_accessor :body_unavailable
|
|
66
28
|
|
|
67
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
68
30
|
def self.attribute_map
|
|
69
31
|
{
|
|
70
|
-
:'
|
|
71
|
-
:'
|
|
72
|
-
:'
|
|
73
|
-
:'
|
|
74
|
-
:'
|
|
75
|
-
:'from' => :'from',
|
|
76
|
-
:'to' => :'to',
|
|
77
|
-
:'snippet' => :'snippet',
|
|
78
|
-
:'has_attachments' => :'has_attachments',
|
|
79
|
-
:'attachments' => :'attachments',
|
|
80
|
-
:'annotations' => :'annotations',
|
|
81
|
-
:'received_at' => :'received_at',
|
|
82
|
-
:'body' => :'body'
|
|
32
|
+
:'thread_id' => :'thread_id',
|
|
33
|
+
:'mailbox' => :'mailbox',
|
|
34
|
+
:'message' => :'message',
|
|
35
|
+
:'body' => :'body',
|
|
36
|
+
:'body_unavailable' => :'body_unavailable'
|
|
83
37
|
}
|
|
84
38
|
end
|
|
85
39
|
|
|
@@ -96,19 +50,11 @@ module Lockally
|
|
|
96
50
|
# Attribute type mapping.
|
|
97
51
|
def self.openapi_types
|
|
98
52
|
{
|
|
99
|
-
:'
|
|
100
|
-
:'
|
|
101
|
-
:'
|
|
102
|
-
:'
|
|
103
|
-
:'
|
|
104
|
-
:'from' => :'String',
|
|
105
|
-
:'to' => :'Array<String>',
|
|
106
|
-
:'snippet' => :'String',
|
|
107
|
-
:'has_attachments' => :'Boolean',
|
|
108
|
-
:'attachments' => :'Array<Attachment>',
|
|
109
|
-
:'annotations' => :'Annotations',
|
|
110
|
-
:'received_at' => :'Time',
|
|
111
|
-
:'body' => :'ThreadMessageBodyAllOfBody'
|
|
53
|
+
:'thread_id' => :'String',
|
|
54
|
+
:'mailbox' => :'String',
|
|
55
|
+
:'message' => :'ThreadMessage',
|
|
56
|
+
:'body' => :'ThreadMessageBodyBody',
|
|
57
|
+
:'body_unavailable' => :'String'
|
|
112
58
|
}
|
|
113
59
|
end
|
|
114
60
|
|
|
@@ -118,13 +64,6 @@ module Lockally
|
|
|
118
64
|
])
|
|
119
65
|
end
|
|
120
66
|
|
|
121
|
-
# List of class defined in allOf (OpenAPI v3)
|
|
122
|
-
def self.openapi_all_of
|
|
123
|
-
[
|
|
124
|
-
:'ThreadMessage'
|
|
125
|
-
]
|
|
126
|
-
end
|
|
127
|
-
|
|
128
67
|
# Initializes the object
|
|
129
68
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
69
|
def initialize(attributes = {})
|
|
@@ -141,75 +80,31 @@ module Lockally
|
|
|
141
80
|
h[k.to_sym] = v
|
|
142
81
|
}
|
|
143
82
|
|
|
144
|
-
if attributes.key?(:'
|
|
145
|
-
self.
|
|
83
|
+
if attributes.key?(:'thread_id')
|
|
84
|
+
self.thread_id = attributes[:'thread_id']
|
|
146
85
|
else
|
|
147
|
-
self.
|
|
86
|
+
self.thread_id = nil
|
|
148
87
|
end
|
|
149
88
|
|
|
150
|
-
if attributes.key?(:'
|
|
151
|
-
self.
|
|
89
|
+
if attributes.key?(:'mailbox')
|
|
90
|
+
self.mailbox = attributes[:'mailbox']
|
|
152
91
|
else
|
|
153
|
-
self.
|
|
92
|
+
self.mailbox = nil
|
|
154
93
|
end
|
|
155
94
|
|
|
156
|
-
if attributes.key?(:'
|
|
157
|
-
self.
|
|
95
|
+
if attributes.key?(:'message')
|
|
96
|
+
self.message = attributes[:'message']
|
|
158
97
|
else
|
|
159
|
-
self.
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
if attributes.key?(:'in_reply_to')
|
|
163
|
-
self.in_reply_to = attributes[:'in_reply_to']
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
if attributes.key?(:'subject')
|
|
167
|
-
self.subject = attributes[:'subject']
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
if attributes.key?(:'from')
|
|
171
|
-
self.from = attributes[:'from']
|
|
172
|
-
else
|
|
173
|
-
self.from = nil
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
if attributes.key?(:'to')
|
|
177
|
-
if (value = attributes[:'to']).is_a?(Array)
|
|
178
|
-
self.to = value
|
|
179
|
-
end
|
|
180
|
-
else
|
|
181
|
-
self.to = nil
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
if attributes.key?(:'snippet')
|
|
185
|
-
self.snippet = attributes[:'snippet']
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
if attributes.key?(:'has_attachments')
|
|
189
|
-
self.has_attachments = attributes[:'has_attachments']
|
|
190
|
-
else
|
|
191
|
-
self.has_attachments = nil
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
if attributes.key?(:'attachments')
|
|
195
|
-
if (value = attributes[:'attachments']).is_a?(Array)
|
|
196
|
-
self.attachments = value
|
|
197
|
-
end
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
if attributes.key?(:'annotations')
|
|
201
|
-
self.annotations = attributes[:'annotations']
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
if attributes.key?(:'received_at')
|
|
205
|
-
self.received_at = attributes[:'received_at']
|
|
206
|
-
else
|
|
207
|
-
self.received_at = nil
|
|
98
|
+
self.message = nil
|
|
208
99
|
end
|
|
209
100
|
|
|
210
101
|
if attributes.key?(:'body')
|
|
211
102
|
self.body = attributes[:'body']
|
|
212
103
|
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'body_unavailable')
|
|
106
|
+
self.body_unavailable = attributes[:'body_unavailable']
|
|
107
|
+
end
|
|
213
108
|
end
|
|
214
109
|
|
|
215
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -217,32 +112,16 @@ module Lockally
|
|
|
217
112
|
def list_invalid_properties
|
|
218
113
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
219
114
|
invalid_properties = Array.new
|
|
220
|
-
if @
|
|
221
|
-
invalid_properties.push('invalid value for "
|
|
115
|
+
if @thread_id.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "thread_id", thread_id cannot be nil.')
|
|
222
117
|
end
|
|
223
118
|
|
|
224
|
-
if @
|
|
225
|
-
invalid_properties.push('invalid value for "
|
|
119
|
+
if @mailbox.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "mailbox", mailbox cannot be nil.')
|
|
226
121
|
end
|
|
227
122
|
|
|
228
|
-
if @
|
|
229
|
-
invalid_properties.push('invalid value for "
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
if @from.nil?
|
|
233
|
-
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
if @to.nil?
|
|
237
|
-
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
if @has_attachments.nil?
|
|
241
|
-
invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
if @received_at.nil?
|
|
245
|
-
invalid_properties.push('invalid value for "received_at", received_at cannot be nil.')
|
|
123
|
+
if @message.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
246
125
|
end
|
|
247
126
|
|
|
248
127
|
invalid_properties
|
|
@@ -252,86 +131,40 @@ module Lockally
|
|
|
252
131
|
# @return true if the model is valid
|
|
253
132
|
def valid?
|
|
254
133
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
255
|
-
return false if @
|
|
256
|
-
return false if @
|
|
257
|
-
|
|
258
|
-
return false unless direction_validator.valid?(@direction)
|
|
259
|
-
return false if @rfc_message_id.nil?
|
|
260
|
-
return false if @from.nil?
|
|
261
|
-
return false if @to.nil?
|
|
262
|
-
return false if @has_attachments.nil?
|
|
263
|
-
return false if @received_at.nil?
|
|
134
|
+
return false if @thread_id.nil?
|
|
135
|
+
return false if @mailbox.nil?
|
|
136
|
+
return false if @message.nil?
|
|
264
137
|
true
|
|
265
138
|
end
|
|
266
139
|
|
|
267
140
|
# Custom attribute writer method with validation
|
|
268
|
-
# @param [Object]
|
|
269
|
-
def
|
|
270
|
-
if
|
|
271
|
-
fail ArgumentError, '
|
|
272
|
-
end
|
|
273
|
-
|
|
274
|
-
@id = id
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
278
|
-
# @param [Object] direction Object to be assigned
|
|
279
|
-
def direction=(direction)
|
|
280
|
-
validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
|
|
281
|
-
unless validator.valid?(direction)
|
|
282
|
-
fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
|
|
283
|
-
end
|
|
284
|
-
@direction = direction
|
|
285
|
-
end
|
|
286
|
-
|
|
287
|
-
# Custom attribute writer method with validation
|
|
288
|
-
# @param [Object] rfc_message_id Value to be assigned
|
|
289
|
-
def rfc_message_id=(rfc_message_id)
|
|
290
|
-
if rfc_message_id.nil?
|
|
291
|
-
fail ArgumentError, 'rfc_message_id cannot be nil'
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
@rfc_message_id = rfc_message_id
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
# Custom attribute writer method with validation
|
|
298
|
-
# @param [Object] from Value to be assigned
|
|
299
|
-
def from=(from)
|
|
300
|
-
if from.nil?
|
|
301
|
-
fail ArgumentError, 'from cannot be nil'
|
|
302
|
-
end
|
|
303
|
-
|
|
304
|
-
@from = from
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
# Custom attribute writer method with validation
|
|
308
|
-
# @param [Object] to Value to be assigned
|
|
309
|
-
def to=(to)
|
|
310
|
-
if to.nil?
|
|
311
|
-
fail ArgumentError, 'to cannot be nil'
|
|
141
|
+
# @param [Object] thread_id Value to be assigned
|
|
142
|
+
def thread_id=(thread_id)
|
|
143
|
+
if thread_id.nil?
|
|
144
|
+
fail ArgumentError, 'thread_id cannot be nil'
|
|
312
145
|
end
|
|
313
146
|
|
|
314
|
-
@
|
|
147
|
+
@thread_id = thread_id
|
|
315
148
|
end
|
|
316
149
|
|
|
317
150
|
# Custom attribute writer method with validation
|
|
318
|
-
# @param [Object]
|
|
319
|
-
def
|
|
320
|
-
if
|
|
321
|
-
fail ArgumentError, '
|
|
151
|
+
# @param [Object] mailbox Value to be assigned
|
|
152
|
+
def mailbox=(mailbox)
|
|
153
|
+
if mailbox.nil?
|
|
154
|
+
fail ArgumentError, 'mailbox cannot be nil'
|
|
322
155
|
end
|
|
323
156
|
|
|
324
|
-
@
|
|
157
|
+
@mailbox = mailbox
|
|
325
158
|
end
|
|
326
159
|
|
|
327
160
|
# Custom attribute writer method with validation
|
|
328
|
-
# @param [Object]
|
|
329
|
-
def
|
|
330
|
-
if
|
|
331
|
-
fail ArgumentError, '
|
|
161
|
+
# @param [Object] message Value to be assigned
|
|
162
|
+
def message=(message)
|
|
163
|
+
if message.nil?
|
|
164
|
+
fail ArgumentError, 'message cannot be nil'
|
|
332
165
|
end
|
|
333
166
|
|
|
334
|
-
@
|
|
167
|
+
@message = message
|
|
335
168
|
end
|
|
336
169
|
|
|
337
170
|
# Checks equality by comparing each attribute.
|
|
@@ -339,19 +172,11 @@ module Lockally
|
|
|
339
172
|
def ==(o)
|
|
340
173
|
return true if self.equal?(o)
|
|
341
174
|
self.class == o.class &&
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
from == o.from &&
|
|
348
|
-
to == o.to &&
|
|
349
|
-
snippet == o.snippet &&
|
|
350
|
-
has_attachments == o.has_attachments &&
|
|
351
|
-
attachments == o.attachments &&
|
|
352
|
-
annotations == o.annotations &&
|
|
353
|
-
received_at == o.received_at &&
|
|
354
|
-
body == o.body
|
|
175
|
+
thread_id == o.thread_id &&
|
|
176
|
+
mailbox == o.mailbox &&
|
|
177
|
+
message == o.message &&
|
|
178
|
+
body == o.body &&
|
|
179
|
+
body_unavailable == o.body_unavailable
|
|
355
180
|
end
|
|
356
181
|
|
|
357
182
|
# @see the `==` method
|
|
@@ -363,7 +188,7 @@ module Lockally
|
|
|
363
188
|
# Calculates hash code according to all attributes.
|
|
364
189
|
# @return [Integer] Hash code
|
|
365
190
|
def hash
|
|
366
|
-
[
|
|
191
|
+
[thread_id, mailbox, message, body, body_unavailable].hash
|
|
367
192
|
end
|
|
368
193
|
|
|
369
194
|
# Builds the object from hash
|
|
@@ -14,7 +14,8 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Lockally
|
|
17
|
-
|
|
17
|
+
# Absent when the stored message could not be fetched.
|
|
18
|
+
class ThreadMessageBodyBody < ApiModelBase
|
|
18
19
|
attr_accessor :text
|
|
19
20
|
|
|
20
21
|
attr_accessor :html
|
|
@@ -59,14 +60,14 @@ module Lockally
|
|
|
59
60
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
61
|
def initialize(attributes = {})
|
|
61
62
|
if (!attributes.is_a?(Hash))
|
|
62
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::
|
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::ThreadMessageBodyBody` initialize method"
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
67
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
68
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
69
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::
|
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::ThreadMessageBodyBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
71
|
end
|
|
71
72
|
h[k.to_sym] = v
|
|
72
73
|
}
|
|
@@ -15,22 +15,43 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Lockally
|
|
17
17
|
class Whoami < ApiModelBase
|
|
18
|
-
attr_accessor :tenant_id
|
|
19
|
-
|
|
20
18
|
attr_accessor :tenant
|
|
21
19
|
|
|
22
|
-
# The API key's label.
|
|
23
|
-
attr_accessor :label
|
|
24
|
-
|
|
25
20
|
attr_accessor :scopes
|
|
26
21
|
|
|
22
|
+
attr_accessor :auth
|
|
23
|
+
|
|
24
|
+
attr_accessor :key
|
|
25
|
+
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
27
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
49
|
def self.attribute_map
|
|
29
50
|
{
|
|
30
|
-
:'tenant_id' => :'tenant_id',
|
|
31
51
|
:'tenant' => :'tenant',
|
|
32
|
-
:'
|
|
33
|
-
:'
|
|
52
|
+
:'scopes' => :'scopes',
|
|
53
|
+
:'auth' => :'auth',
|
|
54
|
+
:'key' => :'key'
|
|
34
55
|
}
|
|
35
56
|
end
|
|
36
57
|
|
|
@@ -47,10 +68,10 @@ module Lockally
|
|
|
47
68
|
# Attribute type mapping.
|
|
48
69
|
def self.openapi_types
|
|
49
70
|
{
|
|
50
|
-
:'
|
|
51
|
-
:'
|
|
52
|
-
:'
|
|
53
|
-
:'
|
|
71
|
+
:'tenant' => :'WhoamiTenant',
|
|
72
|
+
:'scopes' => :'Array<String>',
|
|
73
|
+
:'auth' => :'String',
|
|
74
|
+
:'key' => :'WhoamiKey'
|
|
54
75
|
}
|
|
55
76
|
end
|
|
56
77
|
|
|
@@ -76,22 +97,28 @@ module Lockally
|
|
|
76
97
|
h[k.to_sym] = v
|
|
77
98
|
}
|
|
78
99
|
|
|
79
|
-
if attributes.key?(:'tenant_id')
|
|
80
|
-
self.tenant_id = attributes[:'tenant_id']
|
|
81
|
-
end
|
|
82
|
-
|
|
83
100
|
if attributes.key?(:'tenant')
|
|
84
101
|
self.tenant = attributes[:'tenant']
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if attributes.key?(:'label')
|
|
88
|
-
self.label = attributes[:'label']
|
|
102
|
+
else
|
|
103
|
+
self.tenant = nil
|
|
89
104
|
end
|
|
90
105
|
|
|
91
106
|
if attributes.key?(:'scopes')
|
|
92
107
|
if (value = attributes[:'scopes']).is_a?(Array)
|
|
93
108
|
self.scopes = value
|
|
94
109
|
end
|
|
110
|
+
else
|
|
111
|
+
self.scopes = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'auth')
|
|
115
|
+
self.auth = attributes[:'auth']
|
|
116
|
+
else
|
|
117
|
+
self.auth = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'key')
|
|
121
|
+
self.key = attributes[:'key']
|
|
95
122
|
end
|
|
96
123
|
end
|
|
97
124
|
|
|
@@ -100,6 +127,18 @@ module Lockally
|
|
|
100
127
|
def list_invalid_properties
|
|
101
128
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
102
129
|
invalid_properties = Array.new
|
|
130
|
+
if @tenant.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "tenant", tenant cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @scopes.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @auth.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "auth", auth cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
103
142
|
invalid_properties
|
|
104
143
|
end
|
|
105
144
|
|
|
@@ -107,18 +146,53 @@ module Lockally
|
|
|
107
146
|
# @return true if the model is valid
|
|
108
147
|
def valid?
|
|
109
148
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
149
|
+
return false if @tenant.nil?
|
|
150
|
+
return false if @scopes.nil?
|
|
151
|
+
return false if @auth.nil?
|
|
152
|
+
auth_validator = EnumAttributeValidator.new('String', ["api_key", "session"])
|
|
153
|
+
return false unless auth_validator.valid?(@auth)
|
|
110
154
|
true
|
|
111
155
|
end
|
|
112
156
|
|
|
157
|
+
# Custom attribute writer method with validation
|
|
158
|
+
# @param [Object] tenant Value to be assigned
|
|
159
|
+
def tenant=(tenant)
|
|
160
|
+
if tenant.nil?
|
|
161
|
+
fail ArgumentError, 'tenant cannot be nil'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@tenant = tenant
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] scopes Value to be assigned
|
|
169
|
+
def scopes=(scopes)
|
|
170
|
+
if scopes.nil?
|
|
171
|
+
fail ArgumentError, 'scopes cannot be nil'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
@scopes = scopes
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
178
|
+
# @param [Object] auth Object to be assigned
|
|
179
|
+
def auth=(auth)
|
|
180
|
+
validator = EnumAttributeValidator.new('String', ["api_key", "session"])
|
|
181
|
+
unless validator.valid?(auth)
|
|
182
|
+
fail ArgumentError, "invalid value for \"auth\", must be one of #{validator.allowable_values}."
|
|
183
|
+
end
|
|
184
|
+
@auth = auth
|
|
185
|
+
end
|
|
186
|
+
|
|
113
187
|
# Checks equality by comparing each attribute.
|
|
114
188
|
# @param [Object] Object to be compared
|
|
115
189
|
def ==(o)
|
|
116
190
|
return true if self.equal?(o)
|
|
117
191
|
self.class == o.class &&
|
|
118
|
-
tenant_id == o.tenant_id &&
|
|
119
192
|
tenant == o.tenant &&
|
|
120
|
-
|
|
121
|
-
|
|
193
|
+
scopes == o.scopes &&
|
|
194
|
+
auth == o.auth &&
|
|
195
|
+
key == o.key
|
|
122
196
|
end
|
|
123
197
|
|
|
124
198
|
# @see the `==` method
|
|
@@ -130,7 +204,7 @@ module Lockally
|
|
|
130
204
|
# Calculates hash code according to all attributes.
|
|
131
205
|
# @return [Integer] Hash code
|
|
132
206
|
def hash
|
|
133
|
-
[
|
|
207
|
+
[tenant, scopes, auth, key].hash
|
|
134
208
|
end
|
|
135
209
|
|
|
136
210
|
# Builds the object from hash
|