lockally 0.3.0 → 0.3.2
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 +12 -5
- data/docs/AgentSendResult.md +6 -2
- data/docs/Annotations.md +22 -0
- data/docs/Attachment.md +26 -0
- data/docs/Classification.md +24 -0
- data/docs/Draft.md +1 -1
- data/docs/DraftResult.md +1 -1
- data/docs/InjectionRisk.md +20 -0
- data/docs/MailboxGrant.md +7 -3
- data/docs/MailboxGrantList.md +2 -2
- data/docs/MarkReadResult.md +2 -0
- data/docs/PolicyFlags.md +28 -0
- data/docs/SimulatedInbound.md +7 -1
- data/docs/ThreadClassification.md +3 -1
- data/docs/ThreadMessage.md +2 -2
- data/docs/ThreadMessageBody.md +10 -26
- data/docs/{ThreadMessageBodyAllOfBody.md → ThreadMessageBodyBody.md} +2 -2
- data/docs/Whoami.md +7 -7
- data/docs/WhoamiKey.md +20 -0
- data/docs/WhoamiTenant.md +22 -0
- data/lib/lockally/models/agent_send_result.rb +72 -1
- data/lib/lockally/models/annotations.rb +168 -0
- data/lib/lockally/models/attachment.rb +185 -0
- data/lib/lockally/models/classification.rb +211 -0
- data/lib/lockally/models/draft.rb +2 -4
- data/lib/lockally/models/draft_result.rb +2 -4
- data/lib/lockally/models/injection_risk.rb +159 -0
- 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/policy_flags.rb +197 -0
- data/lib/lockally/models/simulated_inbound.rb +31 -5
- data/lib/lockally/models/thread_classification.rb +13 -6
- data/lib/lockally/models/thread_message.rb +3 -6
- data/lib/lockally/models/thread_message_body.rb +58 -236
- 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 +8 -1
- data/spec/models/agent_send_result_spec.rb +12 -0
- data/spec/models/annotations_spec.rb +48 -0
- data/spec/models/attachment_spec.rb +60 -0
- data/spec/models/classification_spec.rb +58 -0
- data/spec/models/injection_risk_spec.rb +42 -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/policy_flags_spec.rb +66 -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 +33 -5
|
@@ -20,7 +20,9 @@ module Lockally
|
|
|
20
20
|
# True when a previous classification was reused.
|
|
21
21
|
attr_accessor :cached
|
|
22
22
|
|
|
23
|
-
#
|
|
23
|
+
# True when this call consumed an AI unit.
|
|
24
|
+
attr_accessor :billed
|
|
25
|
+
|
|
24
26
|
attr_accessor :classification
|
|
25
27
|
|
|
26
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -28,6 +30,7 @@ module Lockally
|
|
|
28
30
|
{
|
|
29
31
|
:'thread_id' => :'thread_id',
|
|
30
32
|
:'cached' => :'cached',
|
|
33
|
+
:'billed' => :'billed',
|
|
31
34
|
:'classification' => :'classification'
|
|
32
35
|
}
|
|
33
36
|
end
|
|
@@ -47,7 +50,8 @@ module Lockally
|
|
|
47
50
|
{
|
|
48
51
|
:'thread_id' => :'String',
|
|
49
52
|
:'cached' => :'Boolean',
|
|
50
|
-
:'
|
|
53
|
+
:'billed' => :'Boolean',
|
|
54
|
+
:'classification' => :'Classification'
|
|
51
55
|
}
|
|
52
56
|
end
|
|
53
57
|
|
|
@@ -83,10 +87,12 @@ module Lockally
|
|
|
83
87
|
self.cached = attributes[:'cached']
|
|
84
88
|
end
|
|
85
89
|
|
|
90
|
+
if attributes.key?(:'billed')
|
|
91
|
+
self.billed = attributes[:'billed']
|
|
92
|
+
end
|
|
93
|
+
|
|
86
94
|
if attributes.key?(:'classification')
|
|
87
|
-
|
|
88
|
-
self.classification = value
|
|
89
|
-
end
|
|
95
|
+
self.classification = attributes[:'classification']
|
|
90
96
|
end
|
|
91
97
|
end
|
|
92
98
|
|
|
@@ -127,6 +133,7 @@ module Lockally
|
|
|
127
133
|
self.class == o.class &&
|
|
128
134
|
thread_id == o.thread_id &&
|
|
129
135
|
cached == o.cached &&
|
|
136
|
+
billed == o.billed &&
|
|
130
137
|
classification == o.classification
|
|
131
138
|
end
|
|
132
139
|
|
|
@@ -139,7 +146,7 @@ module Lockally
|
|
|
139
146
|
# Calculates hash code according to all attributes.
|
|
140
147
|
# @return [Integer] Hash code
|
|
141
148
|
def hash
|
|
142
|
-
[thread_id, cached, classification].hash
|
|
149
|
+
[thread_id, cached, billed, classification].hash
|
|
143
150
|
end
|
|
144
151
|
|
|
145
152
|
# Builds the object from hash
|
|
@@ -36,7 +36,6 @@ module Lockally
|
|
|
36
36
|
|
|
37
37
|
attr_accessor :attachments
|
|
38
38
|
|
|
39
|
-
# Signals computed at ingest
|
|
40
39
|
attr_accessor :annotations
|
|
41
40
|
|
|
42
41
|
attr_accessor :received_at
|
|
@@ -103,8 +102,8 @@ module Lockally
|
|
|
103
102
|
:'to' => :'Array<String>',
|
|
104
103
|
:'snippet' => :'String',
|
|
105
104
|
:'has_attachments' => :'Boolean',
|
|
106
|
-
:'attachments' => :'Array<
|
|
107
|
-
:'annotations' => :'
|
|
105
|
+
:'attachments' => :'Array<Attachment>',
|
|
106
|
+
:'annotations' => :'Annotations',
|
|
108
107
|
:'received_at' => :'Time'
|
|
109
108
|
}
|
|
110
109
|
end
|
|
@@ -188,9 +187,7 @@ module Lockally
|
|
|
188
187
|
end
|
|
189
188
|
|
|
190
189
|
if attributes.key?(:'annotations')
|
|
191
|
-
|
|
192
|
-
self.annotations = value
|
|
193
|
-
end
|
|
190
|
+
self.annotations = attributes[:'annotations']
|
|
194
191
|
end
|
|
195
192
|
|
|
196
193
|
if attributes.key?(:'received_at')
|
|
@@ -15,72 +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
|
-
# Signals computed at ingest
|
|
40
|
-
attr_accessor :annotations
|
|
41
|
-
|
|
42
|
-
attr_accessor :received_at
|
|
22
|
+
attr_accessor :message
|
|
43
23
|
|
|
44
24
|
attr_accessor :body
|
|
45
25
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
attr_reader :allowable_values
|
|
49
|
-
|
|
50
|
-
def initialize(datatype, allowable_values)
|
|
51
|
-
@allowable_values = allowable_values.map do |value|
|
|
52
|
-
case datatype.to_s
|
|
53
|
-
when /Integer/i
|
|
54
|
-
value.to_i
|
|
55
|
-
when /Float/i
|
|
56
|
-
value.to_f
|
|
57
|
-
else
|
|
58
|
-
value
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def valid?(value)
|
|
64
|
-
!value || allowable_values.include?(value)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
26
|
+
# Present instead of body when the message could not be located in the mailbox.
|
|
27
|
+
attr_accessor :body_unavailable
|
|
67
28
|
|
|
68
29
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
69
30
|
def self.attribute_map
|
|
70
31
|
{
|
|
71
|
-
:'
|
|
72
|
-
:'
|
|
73
|
-
:'
|
|
74
|
-
:'
|
|
75
|
-
:'
|
|
76
|
-
:'from' => :'from',
|
|
77
|
-
:'to' => :'to',
|
|
78
|
-
:'snippet' => :'snippet',
|
|
79
|
-
:'has_attachments' => :'has_attachments',
|
|
80
|
-
:'attachments' => :'attachments',
|
|
81
|
-
:'annotations' => :'annotations',
|
|
82
|
-
:'received_at' => :'received_at',
|
|
83
|
-
:'body' => :'body'
|
|
32
|
+
:'thread_id' => :'thread_id',
|
|
33
|
+
:'mailbox' => :'mailbox',
|
|
34
|
+
:'message' => :'message',
|
|
35
|
+
:'body' => :'body',
|
|
36
|
+
:'body_unavailable' => :'body_unavailable'
|
|
84
37
|
}
|
|
85
38
|
end
|
|
86
39
|
|
|
@@ -97,19 +50,11 @@ module Lockally
|
|
|
97
50
|
# Attribute type mapping.
|
|
98
51
|
def self.openapi_types
|
|
99
52
|
{
|
|
100
|
-
:'
|
|
101
|
-
:'
|
|
102
|
-
:'
|
|
103
|
-
:'
|
|
104
|
-
:'
|
|
105
|
-
:'from' => :'String',
|
|
106
|
-
:'to' => :'Array<String>',
|
|
107
|
-
:'snippet' => :'String',
|
|
108
|
-
:'has_attachments' => :'Boolean',
|
|
109
|
-
:'attachments' => :'Array<Hash<String, Object>>',
|
|
110
|
-
:'annotations' => :'Hash<String, Object>',
|
|
111
|
-
:'received_at' => :'Time',
|
|
112
|
-
:'body' => :'ThreadMessageBodyAllOfBody'
|
|
53
|
+
:'thread_id' => :'String',
|
|
54
|
+
:'mailbox' => :'String',
|
|
55
|
+
:'message' => :'ThreadMessage',
|
|
56
|
+
:'body' => :'ThreadMessageBodyBody',
|
|
57
|
+
:'body_unavailable' => :'String'
|
|
113
58
|
}
|
|
114
59
|
end
|
|
115
60
|
|
|
@@ -119,13 +64,6 @@ module Lockally
|
|
|
119
64
|
])
|
|
120
65
|
end
|
|
121
66
|
|
|
122
|
-
# List of class defined in allOf (OpenAPI v3)
|
|
123
|
-
def self.openapi_all_of
|
|
124
|
-
[
|
|
125
|
-
:'ThreadMessage'
|
|
126
|
-
]
|
|
127
|
-
end
|
|
128
|
-
|
|
129
67
|
# Initializes the object
|
|
130
68
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
131
69
|
def initialize(attributes = {})
|
|
@@ -142,77 +80,31 @@ module Lockally
|
|
|
142
80
|
h[k.to_sym] = v
|
|
143
81
|
}
|
|
144
82
|
|
|
145
|
-
if attributes.key?(:'
|
|
146
|
-
self.
|
|
83
|
+
if attributes.key?(:'thread_id')
|
|
84
|
+
self.thread_id = attributes[:'thread_id']
|
|
147
85
|
else
|
|
148
|
-
self.
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
if attributes.key?(:'direction')
|
|
152
|
-
self.direction = attributes[:'direction']
|
|
153
|
-
else
|
|
154
|
-
self.direction = nil
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
if attributes.key?(:'rfc_message_id')
|
|
158
|
-
self.rfc_message_id = attributes[:'rfc_message_id']
|
|
159
|
-
else
|
|
160
|
-
self.rfc_message_id = nil
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
if attributes.key?(:'in_reply_to')
|
|
164
|
-
self.in_reply_to = attributes[:'in_reply_to']
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
if attributes.key?(:'subject')
|
|
168
|
-
self.subject = attributes[:'subject']
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
if attributes.key?(:'from')
|
|
172
|
-
self.from = attributes[:'from']
|
|
173
|
-
else
|
|
174
|
-
self.from = nil
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
if attributes.key?(:'to')
|
|
178
|
-
if (value = attributes[:'to']).is_a?(Array)
|
|
179
|
-
self.to = value
|
|
180
|
-
end
|
|
181
|
-
else
|
|
182
|
-
self.to = nil
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
if attributes.key?(:'snippet')
|
|
186
|
-
self.snippet = attributes[:'snippet']
|
|
86
|
+
self.thread_id = nil
|
|
187
87
|
end
|
|
188
88
|
|
|
189
|
-
if attributes.key?(:'
|
|
190
|
-
self.
|
|
89
|
+
if attributes.key?(:'mailbox')
|
|
90
|
+
self.mailbox = attributes[:'mailbox']
|
|
191
91
|
else
|
|
192
|
-
self.
|
|
92
|
+
self.mailbox = nil
|
|
193
93
|
end
|
|
194
94
|
|
|
195
|
-
if attributes.key?(:'
|
|
196
|
-
|
|
197
|
-
self.attachments = value
|
|
198
|
-
end
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
if attributes.key?(:'annotations')
|
|
202
|
-
if (value = attributes[:'annotations']).is_a?(Hash)
|
|
203
|
-
self.annotations = value
|
|
204
|
-
end
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
if attributes.key?(:'received_at')
|
|
208
|
-
self.received_at = attributes[:'received_at']
|
|
95
|
+
if attributes.key?(:'message')
|
|
96
|
+
self.message = attributes[:'message']
|
|
209
97
|
else
|
|
210
|
-
self.
|
|
98
|
+
self.message = nil
|
|
211
99
|
end
|
|
212
100
|
|
|
213
101
|
if attributes.key?(:'body')
|
|
214
102
|
self.body = attributes[:'body']
|
|
215
103
|
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'body_unavailable')
|
|
106
|
+
self.body_unavailable = attributes[:'body_unavailable']
|
|
107
|
+
end
|
|
216
108
|
end
|
|
217
109
|
|
|
218
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -220,32 +112,16 @@ module Lockally
|
|
|
220
112
|
def list_invalid_properties
|
|
221
113
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
222
114
|
invalid_properties = Array.new
|
|
223
|
-
if @
|
|
224
|
-
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.')
|
|
225
117
|
end
|
|
226
118
|
|
|
227
|
-
if @
|
|
228
|
-
invalid_properties.push('invalid value for "
|
|
119
|
+
if @mailbox.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "mailbox", mailbox cannot be nil.')
|
|
229
121
|
end
|
|
230
122
|
|
|
231
|
-
if @
|
|
232
|
-
invalid_properties.push('invalid value for "
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
if @from.nil?
|
|
236
|
-
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
237
|
-
end
|
|
238
|
-
|
|
239
|
-
if @to.nil?
|
|
240
|
-
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
if @has_attachments.nil?
|
|
244
|
-
invalid_properties.push('invalid value for "has_attachments", has_attachments cannot be nil.')
|
|
245
|
-
end
|
|
246
|
-
|
|
247
|
-
if @received_at.nil?
|
|
248
|
-
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.')
|
|
249
125
|
end
|
|
250
126
|
|
|
251
127
|
invalid_properties
|
|
@@ -255,86 +131,40 @@ module Lockally
|
|
|
255
131
|
# @return true if the model is valid
|
|
256
132
|
def valid?
|
|
257
133
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
258
|
-
return false if @
|
|
259
|
-
return false if @
|
|
260
|
-
|
|
261
|
-
return false unless direction_validator.valid?(@direction)
|
|
262
|
-
return false if @rfc_message_id.nil?
|
|
263
|
-
return false if @from.nil?
|
|
264
|
-
return false if @to.nil?
|
|
265
|
-
return false if @has_attachments.nil?
|
|
266
|
-
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?
|
|
267
137
|
true
|
|
268
138
|
end
|
|
269
139
|
|
|
270
140
|
# Custom attribute writer method with validation
|
|
271
|
-
# @param [Object]
|
|
272
|
-
def
|
|
273
|
-
if
|
|
274
|
-
fail ArgumentError, '
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
@id = id
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
281
|
-
# @param [Object] direction Object to be assigned
|
|
282
|
-
def direction=(direction)
|
|
283
|
-
validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
|
|
284
|
-
unless validator.valid?(direction)
|
|
285
|
-
fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}."
|
|
286
|
-
end
|
|
287
|
-
@direction = direction
|
|
288
|
-
end
|
|
289
|
-
|
|
290
|
-
# Custom attribute writer method with validation
|
|
291
|
-
# @param [Object] rfc_message_id Value to be assigned
|
|
292
|
-
def rfc_message_id=(rfc_message_id)
|
|
293
|
-
if rfc_message_id.nil?
|
|
294
|
-
fail ArgumentError, 'rfc_message_id cannot be nil'
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
@rfc_message_id = rfc_message_id
|
|
298
|
-
end
|
|
299
|
-
|
|
300
|
-
# Custom attribute writer method with validation
|
|
301
|
-
# @param [Object] from Value to be assigned
|
|
302
|
-
def from=(from)
|
|
303
|
-
if from.nil?
|
|
304
|
-
fail ArgumentError, 'from cannot be nil'
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
@from = from
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
# Custom attribute writer method with validation
|
|
311
|
-
# @param [Object] to Value to be assigned
|
|
312
|
-
def to=(to)
|
|
313
|
-
if to.nil?
|
|
314
|
-
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'
|
|
315
145
|
end
|
|
316
146
|
|
|
317
|
-
@
|
|
147
|
+
@thread_id = thread_id
|
|
318
148
|
end
|
|
319
149
|
|
|
320
150
|
# Custom attribute writer method with validation
|
|
321
|
-
# @param [Object]
|
|
322
|
-
def
|
|
323
|
-
if
|
|
324
|
-
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'
|
|
325
155
|
end
|
|
326
156
|
|
|
327
|
-
@
|
|
157
|
+
@mailbox = mailbox
|
|
328
158
|
end
|
|
329
159
|
|
|
330
160
|
# Custom attribute writer method with validation
|
|
331
|
-
# @param [Object]
|
|
332
|
-
def
|
|
333
|
-
if
|
|
334
|
-
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'
|
|
335
165
|
end
|
|
336
166
|
|
|
337
|
-
@
|
|
167
|
+
@message = message
|
|
338
168
|
end
|
|
339
169
|
|
|
340
170
|
# Checks equality by comparing each attribute.
|
|
@@ -342,19 +172,11 @@ module Lockally
|
|
|
342
172
|
def ==(o)
|
|
343
173
|
return true if self.equal?(o)
|
|
344
174
|
self.class == o.class &&
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
from == o.from &&
|
|
351
|
-
to == o.to &&
|
|
352
|
-
snippet == o.snippet &&
|
|
353
|
-
has_attachments == o.has_attachments &&
|
|
354
|
-
attachments == o.attachments &&
|
|
355
|
-
annotations == o.annotations &&
|
|
356
|
-
received_at == o.received_at &&
|
|
357
|
-
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
|
|
358
180
|
end
|
|
359
181
|
|
|
360
182
|
# @see the `==` method
|
|
@@ -366,7 +188,7 @@ module Lockally
|
|
|
366
188
|
# Calculates hash code according to all attributes.
|
|
367
189
|
# @return [Integer] Hash code
|
|
368
190
|
def hash
|
|
369
|
-
[
|
|
191
|
+
[thread_id, mailbox, message, body, body_unavailable].hash
|
|
370
192
|
end
|
|
371
193
|
|
|
372
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
|