lockally 0.3.0 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +9 -4
- 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/PolicyFlags.md +28 -0
- data/docs/SimulatedInbound.md +1 -1
- data/docs/ThreadClassification.md +1 -1
- data/docs/ThreadMessage.md +2 -2
- data/docs/ThreadMessageBody.md +2 -2
- 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/policy_flags.rb +197 -0
- data/lib/lockally/models/simulated_inbound.rb +2 -4
- data/lib/lockally/models/thread_classification.rb +2 -5
- data/lib/lockally/models/thread_message.rb +3 -6
- data/lib/lockally/models/thread_message_body.rb +3 -6
- data/lib/lockally/version.rb +1 -1
- data/lib/lockally.rb +5 -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/policy_flags_spec.rb +66 -0
- metadata +21 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#lockally control plane
|
|
3
|
+
|
|
4
|
+
#The lockally control plane lets integrators and direct customers manage everything except actual mail data flow (which uses standard JMAP / IMAP / SMTP-submission against the data plane endpoints). **Authentication.** All `/v1/*` endpoints require a Bearer API key in the `Authorization` header. Keys are formatted `lk_live_<8-char-prefix>_<32-char-secret>`, or `lk_test_<...>` for a test key. Create keys in the dashboard, or with `POST /v1/api-keys` using a key that holds `tenant:admin`. The key's plan is checked on every request, so a key stops working if the account moves to a plan without API access, and works again if it moves back. **Errors.** Failures return [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) `application/problem+json` documents. **Scopes.** Each endpoint requires a specific scope on the presented key. Insufficient scope returns `403` with the required scope name in `detail`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
Contact: support@lockally.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Lockally
|
|
17
|
+
class Classification < ApiModelBase
|
|
18
|
+
# For example support_request, sales_lead, billing, spam.
|
|
19
|
+
attr_accessor :intent
|
|
20
|
+
|
|
21
|
+
attr_accessor :urgency
|
|
22
|
+
|
|
23
|
+
# One line.
|
|
24
|
+
attr_accessor :summary
|
|
25
|
+
|
|
26
|
+
# One line.
|
|
27
|
+
attr_accessor :suggested_action
|
|
28
|
+
|
|
29
|
+
class EnumAttributeValidator
|
|
30
|
+
attr_reader :datatype
|
|
31
|
+
attr_reader :allowable_values
|
|
32
|
+
|
|
33
|
+
def initialize(datatype, allowable_values)
|
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
|
35
|
+
case datatype.to_s
|
|
36
|
+
when /Integer/i
|
|
37
|
+
value.to_i
|
|
38
|
+
when /Float/i
|
|
39
|
+
value.to_f
|
|
40
|
+
else
|
|
41
|
+
value
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def valid?(value)
|
|
47
|
+
!value || allowable_values.include?(value)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'intent' => :'intent',
|
|
55
|
+
:'urgency' => :'urgency',
|
|
56
|
+
:'summary' => :'summary',
|
|
57
|
+
:'suggested_action' => :'suggested_action'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'intent' => :'String',
|
|
75
|
+
:'urgency' => :'String',
|
|
76
|
+
:'summary' => :'String',
|
|
77
|
+
:'suggested_action' => :'String'
|
|
78
|
+
}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# List of attributes with nullable: true
|
|
82
|
+
def self.openapi_nullable
|
|
83
|
+
Set.new([
|
|
84
|
+
])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Initializes the object
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
def initialize(attributes = {})
|
|
90
|
+
if (!attributes.is_a?(Hash))
|
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::Classification` initialize method"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
95
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::Classification`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'intent')
|
|
104
|
+
self.intent = attributes[:'intent']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'urgency')
|
|
108
|
+
self.urgency = attributes[:'urgency']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'summary')
|
|
112
|
+
self.summary = attributes[:'summary']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'suggested_action')
|
|
116
|
+
self.suggested_action = attributes[:'suggested_action']
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
124
|
+
invalid_properties = Array.new
|
|
125
|
+
invalid_properties
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Check to see if the all the properties in the model are valid
|
|
129
|
+
# @return true if the model is valid
|
|
130
|
+
def valid?
|
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
urgency_validator = EnumAttributeValidator.new('String', ["low", "normal", "high"])
|
|
133
|
+
return false unless urgency_validator.valid?(@urgency)
|
|
134
|
+
true
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
138
|
+
# @param [Object] urgency Object to be assigned
|
|
139
|
+
def urgency=(urgency)
|
|
140
|
+
validator = EnumAttributeValidator.new('String', ["low", "normal", "high"])
|
|
141
|
+
unless validator.valid?(urgency)
|
|
142
|
+
fail ArgumentError, "invalid value for \"urgency\", must be one of #{validator.allowable_values}."
|
|
143
|
+
end
|
|
144
|
+
@urgency = urgency
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Checks equality by comparing each attribute.
|
|
148
|
+
# @param [Object] Object to be compared
|
|
149
|
+
def ==(o)
|
|
150
|
+
return true if self.equal?(o)
|
|
151
|
+
self.class == o.class &&
|
|
152
|
+
intent == o.intent &&
|
|
153
|
+
urgency == o.urgency &&
|
|
154
|
+
summary == o.summary &&
|
|
155
|
+
suggested_action == o.suggested_action
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @see the `==` method
|
|
159
|
+
# @param [Object] Object to be compared
|
|
160
|
+
def eql?(o)
|
|
161
|
+
self == o
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Calculates hash code according to all attributes.
|
|
165
|
+
# @return [Integer] Hash code
|
|
166
|
+
def hash
|
|
167
|
+
[intent, urgency, summary, suggested_action].hash
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Builds the object from hash
|
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
172
|
+
# @return [Object] Returns the model itself
|
|
173
|
+
def self.build_from_hash(attributes)
|
|
174
|
+
return nil unless attributes.is_a?(Hash)
|
|
175
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
176
|
+
transformed_hash = {}
|
|
177
|
+
openapi_types.each_pair do |key, type|
|
|
178
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
179
|
+
transformed_hash["#{key}"] = nil
|
|
180
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
181
|
+
# check to ensure the input is an array given that the attribute
|
|
182
|
+
# is documented as an array but the input is not
|
|
183
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
184
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
185
|
+
end
|
|
186
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
187
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
new(transformed_hash)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the object in the form of hash
|
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
|
195
|
+
def to_hash
|
|
196
|
+
hash = {}
|
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
198
|
+
value = self.send(attr)
|
|
199
|
+
if value.nil?
|
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
hash[param] = _to_hash(value)
|
|
205
|
+
end
|
|
206
|
+
hash
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
end
|
|
@@ -107,7 +107,7 @@ module Lockally
|
|
|
107
107
|
:'subject' => :'String',
|
|
108
108
|
:'body_text' => :'String',
|
|
109
109
|
:'status' => :'String',
|
|
110
|
-
:'policy_flags' => :'
|
|
110
|
+
:'policy_flags' => :'PolicyFlags',
|
|
111
111
|
:'reviewed_at' => :'Time',
|
|
112
112
|
:'sent_message_id' => :'String',
|
|
113
113
|
:'created_at' => :'Time',
|
|
@@ -186,9 +186,7 @@ module Lockally
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
if attributes.key?(:'policy_flags')
|
|
189
|
-
|
|
190
|
-
self.policy_flags = value
|
|
191
|
-
end
|
|
189
|
+
self.policy_flags = attributes[:'policy_flags']
|
|
192
190
|
else
|
|
193
191
|
self.policy_flags = nil
|
|
194
192
|
end
|
|
@@ -73,7 +73,7 @@ module Lockally
|
|
|
73
73
|
{
|
|
74
74
|
:'draft_id' => :'String',
|
|
75
75
|
:'status' => :'String',
|
|
76
|
-
:'policy_flags' => :'
|
|
76
|
+
:'policy_flags' => :'PolicyFlags',
|
|
77
77
|
:'thread_id' => :'String',
|
|
78
78
|
:'sent' => :'AgentSendResult'
|
|
79
79
|
}
|
|
@@ -114,9 +114,7 @@ module Lockally
|
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
if attributes.key?(:'policy_flags')
|
|
117
|
-
|
|
118
|
-
self.policy_flags = value
|
|
119
|
-
end
|
|
117
|
+
self.policy_flags = attributes[:'policy_flags']
|
|
120
118
|
else
|
|
121
119
|
self.policy_flags = nil
|
|
122
120
|
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#lockally control plane
|
|
3
|
+
|
|
4
|
+
#The lockally control plane lets integrators and direct customers manage everything except actual mail data flow (which uses standard JMAP / IMAP / SMTP-submission against the data plane endpoints). **Authentication.** All `/v1/*` endpoints require a Bearer API key in the `Authorization` header. Keys are formatted `lk_live_<8-char-prefix>_<32-char-secret>`, or `lk_test_<...>` for a test key. Create keys in the dashboard, or with `POST /v1/api-keys` using a key that holds `tenant:admin`. The key's plan is checked on every request, so a key stops working if the account moves to a plan without API access, and works again if it moves back. **Errors.** Failures return [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) `application/problem+json` documents. **Scopes.** Each endpoint requires a specific scope on the presented key. Insufficient scope returns `403` with the required scope name in `detail`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
Contact: support@lockally.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Lockally
|
|
17
|
+
class InjectionRisk < ApiModelBase
|
|
18
|
+
attr_accessor :flagged
|
|
19
|
+
|
|
20
|
+
# The phrases that tripped the check.
|
|
21
|
+
attr_accessor :signals
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'flagged' => :'flagged',
|
|
27
|
+
:'signals' => :'signals'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'flagged' => :'Boolean',
|
|
45
|
+
:'signals' => :'Array<String>'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::InjectionRisk` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::InjectionRisk`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'flagged')
|
|
72
|
+
self.flagged = attributes[:'flagged']
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'signals')
|
|
76
|
+
if (value = attributes[:'signals']).is_a?(Array)
|
|
77
|
+
self.signals = value
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
|
+
invalid_properties = Array.new
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Checks equality by comparing each attribute.
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def ==(o)
|
|
100
|
+
return true if self.equal?(o)
|
|
101
|
+
self.class == o.class &&
|
|
102
|
+
flagged == o.flagged &&
|
|
103
|
+
signals == o.signals
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Integer] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[flagged, signals].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def self.build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
124
|
+
transformed_hash = {}
|
|
125
|
+
openapi_types.each_pair do |key, type|
|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
127
|
+
transformed_hash["#{key}"] = nil
|
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
new(transformed_hash)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns the object in the form of hash
|
|
142
|
+
# @return [Hash] Returns the object in the form of hash
|
|
143
|
+
def to_hash
|
|
144
|
+
hash = {}
|
|
145
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
146
|
+
value = self.send(attr)
|
|
147
|
+
if value.nil?
|
|
148
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
149
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
hash[param] = _to_hash(value)
|
|
153
|
+
end
|
|
154
|
+
hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
end
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#lockally control plane
|
|
3
|
+
|
|
4
|
+
#The lockally control plane lets integrators and direct customers manage everything except actual mail data flow (which uses standard JMAP / IMAP / SMTP-submission against the data plane endpoints). **Authentication.** All `/v1/*` endpoints require a Bearer API key in the `Authorization` header. Keys are formatted `lk_live_<8-char-prefix>_<32-char-secret>`, or `lk_test_<...>` for a test key. Create keys in the dashboard, or with `POST /v1/api-keys` using a key that holds `tenant:admin`. The key's plan is checked on every request, so a key stops working if the account moves to a plan without API access, and works again if it moves back. **Errors.** Failures return [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) `application/problem+json` documents. **Scopes.** Each endpoint requires a specific scope on the presented key. Insufficient scope returns `403` with the required scope name in `detail`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.0
|
|
7
|
+
Contact: support@lockally.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Lockally
|
|
17
|
+
# Why a draft was held. A key is absent when that check passed. The set is closed: a flag added to the policy engine must be added here too, or typed clients will drop it.
|
|
18
|
+
class PolicyFlags < ApiModelBase
|
|
19
|
+
attr_accessor :always_approve
|
|
20
|
+
|
|
21
|
+
attr_accessor :injection_risk
|
|
22
|
+
|
|
23
|
+
attr_accessor :new_recipient
|
|
24
|
+
|
|
25
|
+
attr_accessor :new_thread
|
|
26
|
+
|
|
27
|
+
attr_accessor :pii
|
|
28
|
+
|
|
29
|
+
attr_accessor :recipient_count
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'always_approve' => :'always_approve',
|
|
35
|
+
:'injection_risk' => :'injection_risk',
|
|
36
|
+
:'new_recipient' => :'new_recipient',
|
|
37
|
+
:'new_thread' => :'new_thread',
|
|
38
|
+
:'pii' => :'pii',
|
|
39
|
+
:'recipient_count' => :'recipient_count'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'always_approve' => :'Boolean',
|
|
57
|
+
:'injection_risk' => :'Boolean',
|
|
58
|
+
:'new_recipient' => :'Array<String>',
|
|
59
|
+
:'new_thread' => :'Boolean',
|
|
60
|
+
:'pii' => :'Array<String>',
|
|
61
|
+
:'recipient_count' => :'Integer'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::PolicyFlags` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Lockally::PolicyFlags`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'always_approve')
|
|
88
|
+
self.always_approve = attributes[:'always_approve']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'injection_risk')
|
|
92
|
+
self.injection_risk = attributes[:'injection_risk']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'new_recipient')
|
|
96
|
+
if (value = attributes[:'new_recipient']).is_a?(Array)
|
|
97
|
+
self.new_recipient = value
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'new_thread')
|
|
102
|
+
self.new_thread = attributes[:'new_thread']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'pii')
|
|
106
|
+
if (value = attributes[:'pii']).is_a?(Array)
|
|
107
|
+
self.pii = value
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'recipient_count')
|
|
112
|
+
self.recipient_count = attributes[:'recipient_count']
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
117
|
+
# @return Array for valid properties with the reasons
|
|
118
|
+
def list_invalid_properties
|
|
119
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
120
|
+
invalid_properties = Array.new
|
|
121
|
+
invalid_properties
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Check to see if the all the properties in the model are valid
|
|
125
|
+
# @return true if the model is valid
|
|
126
|
+
def valid?
|
|
127
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
always_approve == o.always_approve &&
|
|
137
|
+
injection_risk == o.injection_risk &&
|
|
138
|
+
new_recipient == o.new_recipient &&
|
|
139
|
+
new_thread == o.new_thread &&
|
|
140
|
+
pii == o.pii &&
|
|
141
|
+
recipient_count == o.recipient_count
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @see the `==` method
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def eql?(o)
|
|
147
|
+
self == o
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Calculates hash code according to all attributes.
|
|
151
|
+
# @return [Integer] Hash code
|
|
152
|
+
def hash
|
|
153
|
+
[always_approve, injection_risk, new_recipient, new_thread, pii, recipient_count].hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Builds the object from hash
|
|
157
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
158
|
+
# @return [Object] Returns the model itself
|
|
159
|
+
def self.build_from_hash(attributes)
|
|
160
|
+
return nil unless attributes.is_a?(Hash)
|
|
161
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
162
|
+
transformed_hash = {}
|
|
163
|
+
openapi_types.each_pair do |key, type|
|
|
164
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
165
|
+
transformed_hash["#{key}"] = nil
|
|
166
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
167
|
+
# check to ensure the input is an array given that the attribute
|
|
168
|
+
# is documented as an array but the input is not
|
|
169
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
170
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
171
|
+
end
|
|
172
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
173
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
new(transformed_hash)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Returns the object in the form of hash
|
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
|
181
|
+
def to_hash
|
|
182
|
+
hash = {}
|
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
184
|
+
value = self.send(attr)
|
|
185
|
+
if value.nil?
|
|
186
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
187
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
hash[param] = _to_hash(value)
|
|
191
|
+
end
|
|
192
|
+
hash
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
@@ -45,7 +45,7 @@ module Lockally
|
|
|
45
45
|
{
|
|
46
46
|
:'thread_id' => :'String',
|
|
47
47
|
:'message_id' => :'String',
|
|
48
|
-
:'annotations' => :'
|
|
48
|
+
:'annotations' => :'Annotations'
|
|
49
49
|
}
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -80,9 +80,7 @@ module Lockally
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
if attributes.key?(:'annotations')
|
|
83
|
-
|
|
84
|
-
self.annotations = value
|
|
85
|
-
end
|
|
83
|
+
self.annotations = attributes[:'annotations']
|
|
86
84
|
end
|
|
87
85
|
end
|
|
88
86
|
|
|
@@ -20,7 +20,6 @@ module Lockally
|
|
|
20
20
|
# True when a previous classification was reused.
|
|
21
21
|
attr_accessor :cached
|
|
22
22
|
|
|
23
|
-
# Intent
|
|
24
23
|
attr_accessor :classification
|
|
25
24
|
|
|
26
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -47,7 +46,7 @@ module Lockally
|
|
|
47
46
|
{
|
|
48
47
|
:'thread_id' => :'String',
|
|
49
48
|
:'cached' => :'Boolean',
|
|
50
|
-
:'classification' => :'
|
|
49
|
+
:'classification' => :'Classification'
|
|
51
50
|
}
|
|
52
51
|
end
|
|
53
52
|
|
|
@@ -84,9 +83,7 @@ module Lockally
|
|
|
84
83
|
end
|
|
85
84
|
|
|
86
85
|
if attributes.key?(:'classification')
|
|
87
|
-
|
|
88
|
-
self.classification = value
|
|
89
|
-
end
|
|
86
|
+
self.classification = attributes[:'classification']
|
|
90
87
|
end
|
|
91
88
|
end
|
|
92
89
|
|
|
@@ -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')
|