zyphr 0.1.75 → 0.1.77

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -1
  3. data/docs/CreateInboxLabelRequest.md +20 -0
  4. data/docs/Draft.md +36 -0
  5. data/docs/DraftAddress.md +20 -0
  6. data/docs/DraftListResponse.md +20 -0
  7. data/docs/DraftRequest.md +30 -0
  8. data/docs/DraftResponse.md +20 -0
  9. data/docs/ForwardEmailRequest.md +34 -0
  10. data/docs/InboundEmailApi.md +1853 -157
  11. data/docs/InboxLabel.md +26 -0
  12. data/docs/InboxLabelListResponse.md +20 -0
  13. data/docs/InboxLabelResponse.md +20 -0
  14. data/docs/{ReplyToInboundEmailRequest.md → ReplyEmailRequest.md} +3 -3
  15. data/docs/Thread.md +40 -0
  16. data/docs/ThreadEmail.md +38 -0
  17. data/docs/ThreadEmailAttachmentsInner.md +24 -0
  18. data/docs/ThreadEmailFrom.md +20 -0
  19. data/docs/ThreadEmailListResponse.md +20 -0
  20. data/docs/ThreadEmailResponse.md +20 -0
  21. data/docs/ThreadFolder.md +15 -0
  22. data/docs/ThreadLabelsInner.md +22 -0
  23. data/docs/ThreadLabelsRequest.md +18 -0
  24. data/docs/ThreadListResponse.md +20 -0
  25. data/docs/ThreadListResponseMeta.md +20 -0
  26. data/docs/ThreadResponse.md +20 -0
  27. data/docs/UpdateInboxLabelRequest.md +20 -0
  28. data/docs/UpdateThreadRequest.md +22 -0
  29. data/lib/zyphr/api/inbound_email_api.rb +1768 -168
  30. data/lib/zyphr/models/create_inbox_label_request.rb +272 -0
  31. data/lib/zyphr/models/draft.rb +375 -0
  32. data/lib/zyphr/models/draft_address.rb +249 -0
  33. data/lib/zyphr/models/draft_list_response.rb +231 -0
  34. data/lib/zyphr/models/draft_request.rb +299 -0
  35. data/lib/zyphr/models/draft_response.rb +229 -0
  36. data/lib/zyphr/models/forward_email_request.rb +393 -0
  37. data/lib/zyphr/models/inbox_label.rb +258 -0
  38. data/lib/zyphr/models/inbox_label_list_response.rb +231 -0
  39. data/lib/zyphr/models/inbox_label_response.rb +229 -0
  40. data/lib/zyphr/models/{reply_to_inbound_email_request.rb → reply_email_request.rb} +4 -3
  41. data/lib/zyphr/models/thread.rb +352 -0
  42. data/lib/zyphr/models/thread_email.rb +353 -0
  43. data/lib/zyphr/models/thread_email_attachments_inner.rb +248 -0
  44. data/lib/zyphr/models/thread_email_from.rb +230 -0
  45. data/lib/zyphr/models/thread_email_list_response.rb +231 -0
  46. data/lib/zyphr/models/thread_email_response.rb +229 -0
  47. data/lib/zyphr/models/thread_folder.rb +43 -0
  48. data/lib/zyphr/models/thread_labels_inner.rb +239 -0
  49. data/lib/zyphr/models/thread_labels_request.rb +248 -0
  50. data/lib/zyphr/models/thread_list_response.rb +231 -0
  51. data/lib/zyphr/models/thread_list_response_meta.rb +237 -0
  52. data/lib/zyphr/models/thread_response.rb +229 -0
  53. data/lib/zyphr/models/update_inbox_label_request.rb +264 -0
  54. data/lib/zyphr/models/update_thread_request.rb +262 -0
  55. data/lib/zyphr/models/webhook_event_type.rb +12 -1
  56. data/lib/zyphr.rb +25 -1
  57. data/spec/api/inbound_email_api_spec.rb +292 -1
  58. data/spec/models/create_inbox_label_request_spec.rb +42 -0
  59. data/spec/models/draft_address_spec.rb +42 -0
  60. data/spec/models/draft_list_response_spec.rb +42 -0
  61. data/spec/models/draft_request_spec.rb +72 -0
  62. data/spec/models/draft_response_spec.rb +42 -0
  63. data/spec/models/draft_spec.rb +90 -0
  64. data/spec/models/forward_email_request_spec.rb +88 -0
  65. data/spec/models/inbox_label_list_response_spec.rb +42 -0
  66. data/spec/models/inbox_label_response_spec.rb +42 -0
  67. data/spec/models/inbox_label_spec.rb +60 -0
  68. data/spec/models/{reply_to_inbound_email_request_spec.rb → reply_email_request_spec.rb} +6 -6
  69. data/spec/models/thread_email_attachments_inner_spec.rb +54 -0
  70. data/spec/models/thread_email_from_spec.rb +42 -0
  71. data/spec/models/thread_email_list_response_spec.rb +42 -0
  72. data/spec/models/thread_email_response_spec.rb +42 -0
  73. data/spec/models/thread_email_spec.rb +100 -0
  74. data/spec/models/thread_folder_spec.rb +30 -0
  75. data/spec/models/thread_labels_inner_spec.rb +48 -0
  76. data/spec/models/thread_labels_request_spec.rb +36 -0
  77. data/spec/models/thread_list_response_meta_spec.rb +42 -0
  78. data/spec/models/thread_list_response_spec.rb +42 -0
  79. data/spec/models/thread_response_spec.rb +42 -0
  80. data/spec/models/thread_spec.rb +102 -0
  81. data/spec/models/update_inbox_label_request_spec.rb +42 -0
  82. data/spec/models/update_thread_request_spec.rb +48 -0
  83. data/zyphr.gemspec +1 -1
  84. metadata +102 -6
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a developer platform for user authentication and transactional messaging. One API covers auth (passkeys, social sign-in, passwordless, MFA, sessions, organizations) plus email, push notifications, SMS, in-app messages, and webhooks. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account's current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zyphr
17
+ class UpdateInboxLabelRequest
18
+ attr_accessor :name
19
+
20
+ attr_accessor :color
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'name' => :'name',
26
+ :'color' => :'color'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'name' => :'String',
44
+ :'color' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ :'color'
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 `Zyphr::UpdateInboxLabelRequest` 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 `Zyphr::UpdateInboxLabelRequest`. 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?(:'name')
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes.key?(:'color')
76
+ self.color = attributes[:'color']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ if !@name.nil? && @name.to_s.length > 64
86
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 64.')
87
+ end
88
+
89
+ if !@color.nil? && @color.to_s.length > 32
90
+ invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 32.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
100
+ return false if !@name.nil? && @name.to_s.length > 64
101
+ return false if !@color.nil? && @color.to_s.length > 32
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] name Value to be assigned
107
+ def name=(name)
108
+ if name.nil?
109
+ fail ArgumentError, 'name cannot be nil'
110
+ end
111
+
112
+ if name.to_s.length > 64
113
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 64.'
114
+ end
115
+
116
+ @name = name
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] color Value to be assigned
121
+ def color=(color)
122
+ if !color.nil? && color.to_s.length > 32
123
+ fail ArgumentError, 'invalid value for "color", the character length must be smaller than or equal to 32.'
124
+ end
125
+
126
+ @color = color
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ name == o.name &&
135
+ color == o.color
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [name, color].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def self._deserialize(type, value)
178
+ case type.to_sym
179
+ when :Time
180
+ Time.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ # models (e.g. Pet) or oneOf
211
+ klass = Zyphr.const_get(type)
212
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ is_nullable = self.class.openapi_nullable.include?(attr)
236
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
+ end
238
+
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+
262
+ end
263
+
264
+ end
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a developer platform for user authentication and transactional messaging. One API covers auth (passkeys, social sign-in, passwordless, MFA, sessions, organizations) plus email, push notifications, SMS, in-app messages, and webhooks. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account's current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zyphr
17
+ class UpdateThreadRequest
18
+ attr_accessor :folder
19
+
20
+ attr_accessor :read
21
+
22
+ # A member of your account; `null` unassigns
23
+ attr_accessor :assignee_user_id
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'folder' => :'folder',
51
+ :'read' => :'read',
52
+ :'assignee_user_id' => :'assignee_user_id'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'folder' => :'ThreadFolder',
70
+ :'read' => :'Boolean',
71
+ :'assignee_user_id' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'assignee_user_id'
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::UpdateThreadRequest` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::UpdateThreadRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'folder')
99
+ self.folder = attributes[:'folder']
100
+ end
101
+
102
+ if attributes.key?(:'read')
103
+ self.read = attributes[:'read']
104
+ end
105
+
106
+ if attributes.key?(:'assignee_user_id')
107
+ self.assignee_user_id = attributes[:'assignee_user_id']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ folder == o.folder &&
132
+ read == o.read &&
133
+ assignee_user_id == o.assignee_user_id
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [folder, read, assignee_user_id].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ transformed_hash = {}
155
+ openapi_types.each_pair do |key, type|
156
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = nil
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[attribute_map[key]].is_a?(Array)
162
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
163
+ end
164
+ elsif !attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
166
+ end
167
+ end
168
+ new(transformed_hash)
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def self._deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = Zyphr.const_get(type)
210
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -44,9 +44,20 @@ module Zyphr
44
44
  USER_IMPERSONATED = "user.impersonated".freeze
45
45
  DOMAIN_VERIFIED = "domain.verified".freeze
46
46
  DOMAIN_VERIFICATION_FAILED = "domain.verification_failed".freeze
47
+ INBOX_THREAD_CREATED = "inbox.thread.created".freeze
48
+ INBOX_THREAD_FOLDER_UPDATED = "inbox.thread.folder.updated".freeze
49
+ INBOX_THREAD_ASSIGNED = "inbox.thread.assigned".freeze
50
+ INBOX_THREAD_UNASSIGNED = "inbox.thread.unassigned".freeze
51
+ INBOX_THREAD_LABELS_UPDATED = "inbox.thread.labels.updated".freeze
52
+ INBOX_EMAIL_RECEIVED = "inbox.email.received".freeze
53
+ INBOX_EMAIL_SENT = "inbox.email.sent".freeze
54
+ INBOX_DRAFT_CREATED = "inbox.draft.created".freeze
55
+ INBOX_DRAFT_UPDATED = "inbox.draft.updated".freeze
56
+ INBOX_DRAFT_SENT = "inbox.draft.sent".freeze
57
+ INBOX_DRAFT_DELETED = "inbox.draft.deleted".freeze
47
58
 
48
59
  def self.all_vars
49
- @all_vars ||= [EMAIL_QUEUED, EMAIL_SENT, EMAIL_DELIVERED, EMAIL_BOUNCED, EMAIL_SOFT_BOUNCED, EMAIL_COMPLAINED, EMAIL_OPENED, EMAIL_CLICKED, EMAIL_FAILED, EMAIL_SUPPRESSED, EMAIL_RECEIVED, PUSH_SENT, PUSH_DELIVERED, PUSH_FAILED, PUSH_EXPIRED, USER_CREATED, USER_LOGIN, USER_LOGOUT, USER_PASSWORD_CHANGED, USER_PASSWORD_RESET_REQUESTED, USER_EMAIL_VERIFIED, USER_PHONE_VERIFIED, USER_DELETED, USER_SESSION_REVOKED, USER_MFA_ENABLED, USER_MFA_DISABLED, USER_IMPERSONATED, DOMAIN_VERIFIED, DOMAIN_VERIFICATION_FAILED].freeze
60
+ @all_vars ||= [EMAIL_QUEUED, EMAIL_SENT, EMAIL_DELIVERED, EMAIL_BOUNCED, EMAIL_SOFT_BOUNCED, EMAIL_COMPLAINED, EMAIL_OPENED, EMAIL_CLICKED, EMAIL_FAILED, EMAIL_SUPPRESSED, EMAIL_RECEIVED, PUSH_SENT, PUSH_DELIVERED, PUSH_FAILED, PUSH_EXPIRED, USER_CREATED, USER_LOGIN, USER_LOGOUT, USER_PASSWORD_CHANGED, USER_PASSWORD_RESET_REQUESTED, USER_EMAIL_VERIFIED, USER_PHONE_VERIFIED, USER_DELETED, USER_SESSION_REVOKED, USER_MFA_ENABLED, USER_MFA_DISABLED, USER_IMPERSONATED, DOMAIN_VERIFIED, DOMAIN_VERIFICATION_FAILED, INBOX_THREAD_CREATED, INBOX_THREAD_FOLDER_UPDATED, INBOX_THREAD_ASSIGNED, INBOX_THREAD_UNASSIGNED, INBOX_THREAD_LABELS_UPDATED, INBOX_EMAIL_RECEIVED, INBOX_EMAIL_SENT, INBOX_DRAFT_CREATED, INBOX_DRAFT_UPDATED, INBOX_DRAFT_SENT, INBOX_DRAFT_DELETED].freeze
50
61
  end
51
62
 
52
63
  # Builds the enum from string
data/lib/zyphr.rb CHANGED
@@ -84,6 +84,7 @@ require 'zyphr/models/convert_anonymous_user_request_one_of1'
84
84
  require 'zyphr/models/convert_anonymous_user_request_one_of1_apple_user'
85
85
  require 'zyphr/models/convert_anonymous_user_request_one_of1_apple_user_name'
86
86
  require 'zyphr/models/create_category_request'
87
+ require 'zyphr/models/create_inbox_label_request'
87
88
  require 'zyphr/models/create_inbox_request'
88
89
  require 'zyphr/models/create_organization_request'
89
90
  require 'zyphr/models/create_subscriber_request'
@@ -119,6 +120,11 @@ require 'zyphr/models/dns_record'
119
120
  require 'zyphr/models/domain_list_response'
120
121
  require 'zyphr/models/domain_list_response_meta'
121
122
  require 'zyphr/models/domain_response'
123
+ require 'zyphr/models/draft'
124
+ require 'zyphr/models/draft_address'
125
+ require 'zyphr/models/draft_list_response'
126
+ require 'zyphr/models/draft_request'
127
+ require 'zyphr/models/draft_response'
122
128
  require 'zyphr/models/email_address'
123
129
  require 'zyphr/models/email_attachment'
124
130
  require 'zyphr/models/email_event'
@@ -141,6 +147,7 @@ require 'zyphr/models/execution_retry_response_data'
141
147
  require 'zyphr/models/forgot_password_request'
142
148
  require 'zyphr/models/forgot_password_result'
143
149
  require 'zyphr/models/forgot_password_result_data'
150
+ require 'zyphr/models/forward_email_request'
144
151
  require 'zyphr/models/generate_subscriber_token200_response'
145
152
  require 'zyphr/models/generate_subscriber_token200_response_data'
146
153
  require 'zyphr/models/generate_subscriber_token_request'
@@ -178,6 +185,9 @@ require 'zyphr/models/inbound_email_list_response'
178
185
  require 'zyphr/models/inbound_email_list_response_meta'
179
186
  require 'zyphr/models/inbound_email_response'
180
187
  require 'zyphr/models/inbox'
188
+ require 'zyphr/models/inbox_label'
189
+ require 'zyphr/models/inbox_label_list_response'
190
+ require 'zyphr/models/inbox_label_response'
181
191
  require 'zyphr/models/inbox_list_meta'
182
192
  require 'zyphr/models/inbox_list_response'
183
193
  require 'zyphr/models/inbox_list_response_meta'
@@ -301,7 +311,7 @@ require 'zyphr/models/rename_web_authn_credential_request'
301
311
  require 'zyphr/models/render_template_request'
302
312
  require 'zyphr/models/reorder_workflow_steps_request'
303
313
  require 'zyphr/models/replay_webhook_events_request'
304
- require 'zyphr/models/reply_to_inbound_email_request'
314
+ require 'zyphr/models/reply_email_request'
305
315
  require 'zyphr/models/request_meta'
306
316
  require 'zyphr/models/resend_email_verification_request'
307
317
  require 'zyphr/models/reset_password_request'
@@ -400,6 +410,18 @@ require 'zyphr/models/template_render_response'
400
410
  require 'zyphr/models/template_rendered_content'
401
411
  require 'zyphr/models/template_response'
402
412
  require 'zyphr/models/test_webhook_transform_request'
413
+ require 'zyphr/models/thread'
414
+ require 'zyphr/models/thread_email'
415
+ require 'zyphr/models/thread_email_attachments_inner'
416
+ require 'zyphr/models/thread_email_from'
417
+ require 'zyphr/models/thread_email_list_response'
418
+ require 'zyphr/models/thread_email_response'
419
+ require 'zyphr/models/thread_folder'
420
+ require 'zyphr/models/thread_labels_inner'
421
+ require 'zyphr/models/thread_labels_request'
422
+ require 'zyphr/models/thread_list_response'
423
+ require 'zyphr/models/thread_list_response_meta'
424
+ require 'zyphr/models/thread_response'
403
425
  require 'zyphr/models/topic'
404
426
  require 'zyphr/models/topic_delete_response'
405
427
  require 'zyphr/models/topic_list_response'
@@ -425,6 +447,7 @@ require 'zyphr/models/unsubscribe_response'
425
447
  require 'zyphr/models/update_category_request'
426
448
  require 'zyphr/models/update_end_user_by_application_request'
427
449
  require 'zyphr/models/update_end_user_request'
450
+ require 'zyphr/models/update_inbox_label_request'
428
451
  require 'zyphr/models/update_inbox_request'
429
452
  require 'zyphr/models/update_organization_member_role_request'
430
453
  require 'zyphr/models/update_organization_request'
@@ -435,6 +458,7 @@ require 'zyphr/models/update_subscriber_preferences_request'
435
458
  require 'zyphr/models/update_subscriber_preferences_request_preferences_inner'
436
459
  require 'zyphr/models/update_subscriber_request'
437
460
  require 'zyphr/models/update_template_request'
461
+ require 'zyphr/models/update_thread_request'
438
462
  require 'zyphr/models/update_topic_request'
439
463
  require 'zyphr/models/update_waa_s_application_request'
440
464
  require 'zyphr/models/update_waa_s_endpoint200_response'