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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -5
  3. data/docs/AgentSendResult.md +6 -2
  4. data/docs/Annotations.md +22 -0
  5. data/docs/Attachment.md +26 -0
  6. data/docs/Classification.md +24 -0
  7. data/docs/Draft.md +1 -1
  8. data/docs/DraftResult.md +1 -1
  9. data/docs/InjectionRisk.md +20 -0
  10. data/docs/MailboxGrant.md +7 -3
  11. data/docs/MailboxGrantList.md +2 -2
  12. data/docs/MarkReadResult.md +2 -0
  13. data/docs/PolicyFlags.md +28 -0
  14. data/docs/SimulatedInbound.md +7 -1
  15. data/docs/ThreadClassification.md +3 -1
  16. data/docs/ThreadMessage.md +2 -2
  17. data/docs/ThreadMessageBody.md +10 -26
  18. data/docs/{ThreadMessageBodyAllOfBody.md → ThreadMessageBodyBody.md} +2 -2
  19. data/docs/Whoami.md +7 -7
  20. data/docs/WhoamiKey.md +20 -0
  21. data/docs/WhoamiTenant.md +22 -0
  22. data/lib/lockally/models/agent_send_result.rb +72 -1
  23. data/lib/lockally/models/annotations.rb +168 -0
  24. data/lib/lockally/models/attachment.rb +185 -0
  25. data/lib/lockally/models/classification.rb +211 -0
  26. data/lib/lockally/models/draft.rb +2 -4
  27. data/lib/lockally/models/draft_result.rb +2 -4
  28. data/lib/lockally/models/injection_risk.rb +159 -0
  29. data/lib/lockally/models/mailbox_grant.rb +28 -10
  30. data/lib/lockally/models/mailbox_grant_list.rb +17 -17
  31. data/lib/lockally/models/mark_read_result.rb +10 -1
  32. data/lib/lockally/models/policy_flags.rb +197 -0
  33. data/lib/lockally/models/simulated_inbound.rb +31 -5
  34. data/lib/lockally/models/thread_classification.rb +13 -6
  35. data/lib/lockally/models/thread_message.rb +3 -6
  36. data/lib/lockally/models/thread_message_body.rb +58 -236
  37. data/lib/lockally/models/{thread_message_body_all_of_body.rb → thread_message_body_body.rb} +4 -3
  38. data/lib/lockally/models/whoami.rb +98 -24
  39. data/lib/lockally/models/whoami_key.rb +157 -0
  40. data/lib/lockally/models/whoami_tenant.rb +166 -0
  41. data/lib/lockally/version.rb +1 -1
  42. data/lib/lockally.rb +8 -1
  43. data/spec/models/agent_send_result_spec.rb +12 -0
  44. data/spec/models/annotations_spec.rb +48 -0
  45. data/spec/models/attachment_spec.rb +60 -0
  46. data/spec/models/classification_spec.rb +58 -0
  47. data/spec/models/injection_risk_spec.rb +42 -0
  48. data/spec/models/mailbox_grant_list_spec.rb +1 -1
  49. data/spec/models/mailbox_grant_spec.rb +13 -1
  50. data/spec/models/mark_read_result_spec.rb +6 -0
  51. data/spec/models/policy_flags_spec.rb +66 -0
  52. data/spec/models/simulated_inbound_spec.rb +18 -0
  53. data/spec/models/thread_classification_spec.rb +6 -0
  54. data/spec/models/{thread_message_body_all_of_body_spec.rb → thread_message_body_body_spec.rb} +6 -6
  55. data/spec/models/thread_message_body_spec.rb +5 -57
  56. data/spec/models/whoami_key_spec.rb +42 -0
  57. data/spec/models/whoami_spec.rb +8 -4
  58. data/spec/models/whoami_tenant_spec.rb +48 -0
  59. metadata +33 -5
@@ -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
@@ -15,15 +15,21 @@ require 'time'
15
15
 
16
16
  module Lockally
17
17
  class MailboxGrant < ApiModelBase
18
- attr_accessor :id
18
+ attr_accessor :api_key_id
19
+
20
+ attr_accessor :mailbox_id
19
21
 
20
22
  attr_accessor :mailbox
21
23
 
24
+ attr_accessor :created_at
25
+
22
26
  # Attribute mapping from ruby-style variable name to JSON key.
23
27
  def self.attribute_map
24
28
  {
25
- :'id' => :'id',
26
- :'mailbox' => :'mailbox'
29
+ :'api_key_id' => :'api_key_id',
30
+ :'mailbox_id' => :'mailbox_id',
31
+ :'mailbox' => :'mailbox',
32
+ :'created_at' => :'created_at'
27
33
  }
28
34
  end
29
35
 
@@ -40,8 +46,10 @@ module Lockally
40
46
  # Attribute type mapping.
41
47
  def self.openapi_types
42
48
  {
43
- :'id' => :'String',
44
- :'mailbox' => :'String'
49
+ :'api_key_id' => :'String',
50
+ :'mailbox_id' => :'String',
51
+ :'mailbox' => :'String',
52
+ :'created_at' => :'Time'
45
53
  }
46
54
  end
47
55
 
@@ -67,13 +75,21 @@ module Lockally
67
75
  h[k.to_sym] = v
68
76
  }
69
77
 
70
- if attributes.key?(:'id')
71
- self.id = attributes[:'id']
78
+ if attributes.key?(:'api_key_id')
79
+ self.api_key_id = attributes[:'api_key_id']
80
+ end
81
+
82
+ if attributes.key?(:'mailbox_id')
83
+ self.mailbox_id = attributes[:'mailbox_id']
72
84
  end
73
85
 
74
86
  if attributes.key?(:'mailbox')
75
87
  self.mailbox = attributes[:'mailbox']
76
88
  end
89
+
90
+ if attributes.key?(:'created_at')
91
+ self.created_at = attributes[:'created_at']
92
+ end
77
93
  end
78
94
 
79
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -96,8 +112,10 @@ module Lockally
96
112
  def ==(o)
97
113
  return true if self.equal?(o)
98
114
  self.class == o.class &&
99
- id == o.id &&
100
- mailbox == o.mailbox
115
+ api_key_id == o.api_key_id &&
116
+ mailbox_id == o.mailbox_id &&
117
+ mailbox == o.mailbox &&
118
+ created_at == o.created_at
101
119
  end
102
120
 
103
121
  # @see the `==` method
@@ -109,7 +127,7 @@ module Lockally
109
127
  # Calculates hash code according to all attributes.
110
128
  # @return [Integer] Hash code
111
129
  def hash
112
- [id, mailbox].hash
130
+ [api_key_id, mailbox_id, mailbox, created_at].hash
113
131
  end
114
132
 
115
133
  # Builds the object from hash
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module Lockally
17
17
  class MailboxGrantList < ApiModelBase
18
- attr_accessor :mailboxes
18
+ attr_accessor :grants
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'mailboxes' => :'mailboxes'
23
+ :'grants' => :'grants'
24
24
  }
25
25
  end
26
26
 
@@ -37,7 +37,7 @@ module Lockally
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
- :'mailboxes' => :'Array<MailboxGrant>'
40
+ :'grants' => :'Array<MailboxGrant>'
41
41
  }
42
42
  end
43
43
 
@@ -63,12 +63,12 @@ module Lockally
63
63
  h[k.to_sym] = v
64
64
  }
65
65
 
66
- if attributes.key?(:'mailboxes')
67
- if (value = attributes[:'mailboxes']).is_a?(Array)
68
- self.mailboxes = value
66
+ if attributes.key?(:'grants')
67
+ if (value = attributes[:'grants']).is_a?(Array)
68
+ self.grants = value
69
69
  end
70
70
  else
71
- self.mailboxes = nil
71
+ self.grants = nil
72
72
  end
73
73
  end
74
74
 
@@ -77,8 +77,8 @@ module Lockally
77
77
  def list_invalid_properties
78
78
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
79
  invalid_properties = Array.new
80
- if @mailboxes.nil?
81
- invalid_properties.push('invalid value for "mailboxes", mailboxes cannot be nil.')
80
+ if @grants.nil?
81
+ invalid_properties.push('invalid value for "grants", grants cannot be nil.')
82
82
  end
83
83
 
84
84
  invalid_properties
@@ -88,18 +88,18 @@ module Lockally
88
88
  # @return true if the model is valid
89
89
  def valid?
90
90
  warn '[DEPRECATED] the `valid?` method is obsolete'
91
- return false if @mailboxes.nil?
91
+ return false if @grants.nil?
92
92
  true
93
93
  end
94
94
 
95
95
  # Custom attribute writer method with validation
96
- # @param [Object] mailboxes Value to be assigned
97
- def mailboxes=(mailboxes)
98
- if mailboxes.nil?
99
- fail ArgumentError, 'mailboxes cannot be nil'
96
+ # @param [Object] grants Value to be assigned
97
+ def grants=(grants)
98
+ if grants.nil?
99
+ fail ArgumentError, 'grants cannot be nil'
100
100
  end
101
101
 
102
- @mailboxes = mailboxes
102
+ @grants = grants
103
103
  end
104
104
 
105
105
  # Checks equality by comparing each attribute.
@@ -107,7 +107,7 @@ module Lockally
107
107
  def ==(o)
108
108
  return true if self.equal?(o)
109
109
  self.class == o.class &&
110
- mailboxes == o.mailboxes
110
+ grants == o.grants
111
111
  end
112
112
 
113
113
  # @see the `==` method
@@ -119,7 +119,7 @@ module Lockally
119
119
  # Calculates hash code according to all attributes.
120
120
  # @return [Integer] Hash code
121
121
  def hash
122
- [mailboxes].hash
122
+ [grants].hash
123
123
  end
124
124
 
125
125
  # Builds the object from hash
@@ -15,11 +15,14 @@ require 'time'
15
15
 
16
16
  module Lockally
17
17
  class MarkReadResult < ApiModelBase
18
+ attr_accessor :message_id
19
+
18
20
  attr_accessor :read
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
25
+ :'message_id' => :'message_id',
23
26
  :'read' => :'read'
24
27
  }
25
28
  end
@@ -37,6 +40,7 @@ module Lockally
37
40
  # Attribute type mapping.
38
41
  def self.openapi_types
39
42
  {
43
+ :'message_id' => :'String',
40
44
  :'read' => :'Boolean'
41
45
  }
42
46
  end
@@ -63,6 +67,10 @@ module Lockally
63
67
  h[k.to_sym] = v
64
68
  }
65
69
 
70
+ if attributes.key?(:'message_id')
71
+ self.message_id = attributes[:'message_id']
72
+ end
73
+
66
74
  if attributes.key?(:'read')
67
75
  self.read = attributes[:'read']
68
76
  end
@@ -88,6 +96,7 @@ module Lockally
88
96
  def ==(o)
89
97
  return true if self.equal?(o)
90
98
  self.class == o.class &&
99
+ message_id == o.message_id &&
91
100
  read == o.read
92
101
  end
93
102
 
@@ -100,7 +109,7 @@ module Lockally
100
109
  # Calculates hash code according to all attributes.
101
110
  # @return [Integer] Hash code
102
111
  def hash
103
- [read].hash
112
+ [message_id, read].hash
104
113
  end
105
114
 
106
115
  # Builds the object from hash
@@ -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
@@ -15,17 +15,27 @@ require 'time'
15
15
 
16
16
  module Lockally
17
17
  class SimulatedInbound < ApiModelBase
18
+ attr_accessor :simulated
19
+
20
+ # True when the message was adopted into a thread.
21
+ attr_accessor :indexed
22
+
18
23
  attr_accessor :thread_id
19
24
 
20
25
  attr_accessor :message_id
21
26
 
27
+ attr_accessor :rfc_message_id
28
+
22
29
  attr_accessor :annotations
23
30
 
24
31
  # Attribute mapping from ruby-style variable name to JSON key.
25
32
  def self.attribute_map
26
33
  {
34
+ :'simulated' => :'simulated',
35
+ :'indexed' => :'indexed',
27
36
  :'thread_id' => :'thread_id',
28
37
  :'message_id' => :'message_id',
38
+ :'rfc_message_id' => :'rfc_message_id',
29
39
  :'annotations' => :'annotations'
30
40
  }
31
41
  end
@@ -43,9 +53,12 @@ module Lockally
43
53
  # Attribute type mapping.
44
54
  def self.openapi_types
45
55
  {
56
+ :'simulated' => :'Boolean',
57
+ :'indexed' => :'Boolean',
46
58
  :'thread_id' => :'String',
47
59
  :'message_id' => :'String',
48
- :'annotations' => :'Hash<String, Object>'
60
+ :'rfc_message_id' => :'String',
61
+ :'annotations' => :'Annotations'
49
62
  }
50
63
  end
51
64
 
@@ -71,6 +84,14 @@ module Lockally
71
84
  h[k.to_sym] = v
72
85
  }
73
86
 
87
+ if attributes.key?(:'simulated')
88
+ self.simulated = attributes[:'simulated']
89
+ end
90
+
91
+ if attributes.key?(:'indexed')
92
+ self.indexed = attributes[:'indexed']
93
+ end
94
+
74
95
  if attributes.key?(:'thread_id')
75
96
  self.thread_id = attributes[:'thread_id']
76
97
  end
@@ -79,10 +100,12 @@ module Lockally
79
100
  self.message_id = attributes[:'message_id']
80
101
  end
81
102
 
103
+ if attributes.key?(:'rfc_message_id')
104
+ self.rfc_message_id = attributes[:'rfc_message_id']
105
+ end
106
+
82
107
  if attributes.key?(:'annotations')
83
- if (value = attributes[:'annotations']).is_a?(Hash)
84
- self.annotations = value
85
- end
108
+ self.annotations = attributes[:'annotations']
86
109
  end
87
110
  end
88
111
 
@@ -106,8 +129,11 @@ module Lockally
106
129
  def ==(o)
107
130
  return true if self.equal?(o)
108
131
  self.class == o.class &&
132
+ simulated == o.simulated &&
133
+ indexed == o.indexed &&
109
134
  thread_id == o.thread_id &&
110
135
  message_id == o.message_id &&
136
+ rfc_message_id == o.rfc_message_id &&
111
137
  annotations == o.annotations
112
138
  end
113
139
 
@@ -120,7 +146,7 @@ module Lockally
120
146
  # Calculates hash code according to all attributes.
121
147
  # @return [Integer] Hash code
122
148
  def hash
123
- [thread_id, message_id, annotations].hash
149
+ [simulated, indexed, thread_id, message_id, rfc_message_id, annotations].hash
124
150
  end
125
151
 
126
152
  # Builds the object from hash