zyphr 0.1.43 → 0.1.45

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -4
  3. data/docs/ApplicationSelf.md +26 -0
  4. data/docs/ApplicationSelfResponse.md +20 -0
  5. data/docs/AuthApplicationApi.md +158 -0
  6. data/docs/AuthEmailTemplateTestRequest.md +1 -1
  7. data/docs/AuthEmailTemplatesApi.md +1 -1
  8. data/docs/AuthMethods.md +28 -0
  9. data/docs/AuthUserDirectoryApi.md +77 -0
  10. data/docs/AuthUserProfileApi.md +75 -0
  11. data/docs/ChangePasswordRequest.md +20 -0
  12. data/docs/GetEndUserAuthMethods200Response.md +20 -0
  13. data/docs/SetSelfApplicationTestRecipientsRequest.md +18 -0
  14. data/docs/WebhookDelivery.md +1 -1
  15. data/docs/WebhookDeliveryDetail.md +1 -1
  16. data/docs/WebhookEventType.md +15 -0
  17. data/docs/WebhookEventTypesResponseData.md +1 -1
  18. data/docs/WebhookTestEventResponseData.md +1 -1
  19. data/lib/zyphr/api/auth_application_api.rb +147 -0
  20. data/lib/zyphr/api/auth_email_templates_api.rb +2 -2
  21. data/lib/zyphr/api/auth_user_directory_api.rb +63 -0
  22. data/lib/zyphr/api/auth_user_profile_api.rb +68 -0
  23. data/lib/zyphr/models/application_self.rb +371 -0
  24. data/lib/zyphr/models/application_self_response.rb +229 -0
  25. data/lib/zyphr/models/auth_email_template_test_request.rb +1 -1
  26. data/lib/zyphr/models/auth_methods.rb +376 -0
  27. data/lib/zyphr/models/change_password_request.rb +265 -0
  28. data/lib/zyphr/models/get_end_user_auth_methods200_response.rb +229 -0
  29. data/lib/zyphr/models/set_self_application_test_recipients_request.rb +240 -0
  30. data/lib/zyphr/models/webhook_delivery.rb +1 -1
  31. data/lib/zyphr/models/webhook_delivery_detail.rb +1 -1
  32. data/lib/zyphr/models/webhook_event_type.rb +66 -0
  33. data/lib/zyphr/models/webhook_event_types_response_data.rb +1 -1
  34. data/lib/zyphr/models/webhook_test_event_response_data.rb +23 -1
  35. data/lib/zyphr.rb +8 -0
  36. data/spec/api/auth_application_api_spec.rb +58 -0
  37. data/spec/api/auth_email_templates_api_spec.rb +1 -1
  38. data/spec/api/auth_user_directory_api_spec.rb +12 -0
  39. data/spec/api/auth_user_profile_api_spec.rb +12 -0
  40. data/spec/models/application_self_response_spec.rb +42 -0
  41. data/spec/models/application_self_spec.rb +68 -0
  42. data/spec/models/auth_methods_spec.rb +66 -0
  43. data/spec/models/change_password_request_spec.rb +42 -0
  44. data/spec/models/get_end_user_auth_methods200_response_spec.rb +42 -0
  45. data/spec/models/set_self_application_test_recipients_request_spec.rb +36 -0
  46. data/spec/models/webhook_event_type_spec.rb +30 -0
  47. data/zyphr.gemspec +1 -1
  48. metadata +33 -1
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## 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. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## 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 GetEndUserAuthMethods200Response
18
+ attr_accessor :data
19
+
20
+ attr_accessor :meta
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'data' => :'data',
26
+ :'meta' => :'meta'
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
+ :'data' => :'AuthMethods',
44
+ :'meta' => :'GetDomain200ResponseMeta'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::GetEndUserAuthMethods200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::GetEndUserAuthMethods200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'data')
71
+ self.data = attributes[:'data']
72
+ end
73
+
74
+ if attributes.key?(:'meta')
75
+ self.meta = attributes[:'meta']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ data == o.data &&
100
+ meta == o.meta
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [data, meta].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = Zyphr.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_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
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## 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. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## 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 SetSelfApplicationTestRecipientsRequest
18
+ # Email addresses allowed to receive auth emails. An empty array clears the allowlist (disables the gate).
19
+ attr_accessor :test_recipients
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'test_recipients' => :'test_recipients'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'test_recipients' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::SetSelfApplicationTestRecipientsRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::SetSelfApplicationTestRecipientsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'test_recipients')
68
+ if (value = attributes[:'test_recipients']).is_a?(Array)
69
+ self.test_recipients = value
70
+ end
71
+ else
72
+ self.test_recipients = nil
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @test_recipients.nil?
82
+ invalid_properties.push('invalid value for "test_recipients", test_recipients cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ return false if @test_recipients.nil?
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] test_recipients Value to be assigned
98
+ def test_recipients=(test_recipients)
99
+ if test_recipients.nil?
100
+ fail ArgumentError, 'test_recipients cannot be nil'
101
+ end
102
+
103
+ @test_recipients = test_recipients
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ test_recipients == o.test_recipients
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [test_recipients].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def self._deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = Zyphr.const_get(type)
188
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -107,7 +107,7 @@ module Zyphr
107
107
  :'id' => :'String',
108
108
  :'msg_id' => :'String',
109
109
  :'event_id' => :'String',
110
- :'event_type' => :'String',
110
+ :'event_type' => :'WebhookEventType',
111
111
  :'status' => :'String',
112
112
  :'attempts' => :'Integer',
113
113
  :'max_attempts' => :'Integer',
@@ -120,7 +120,7 @@ module Zyphr
120
120
  :'id' => :'String',
121
121
  :'msg_id' => :'String',
122
122
  :'event_id' => :'String',
123
- :'event_type' => :'String',
123
+ :'event_type' => :'WebhookEventType',
124
124
  :'status' => :'String',
125
125
  :'attempts' => :'Integer',
126
126
  :'max_attempts' => :'Integer',
@@ -0,0 +1,66 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## 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. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## 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 WebhookEventType
18
+ EMAIL_QUEUED = "email.queued".freeze
19
+ EMAIL_SENT = "email.sent".freeze
20
+ EMAIL_DELIVERED = "email.delivered".freeze
21
+ EMAIL_BOUNCED = "email.bounced".freeze
22
+ EMAIL_SOFT_BOUNCED = "email.soft_bounced".freeze
23
+ EMAIL_COMPLAINED = "email.complained".freeze
24
+ EMAIL_OPENED = "email.opened".freeze
25
+ EMAIL_CLICKED = "email.clicked".freeze
26
+ EMAIL_FAILED = "email.failed".freeze
27
+ EMAIL_RECEIVED = "email.received".freeze
28
+ PUSH_SENT = "push.sent".freeze
29
+ PUSH_DELIVERED = "push.delivered".freeze
30
+ PUSH_FAILED = "push.failed".freeze
31
+ PUSH_EXPIRED = "push.expired".freeze
32
+ USER_CREATED = "user.created".freeze
33
+ USER_LOGIN = "user.login".freeze
34
+ USER_LOGOUT = "user.logout".freeze
35
+ USER_PASSWORD_CHANGED = "user.password_changed".freeze
36
+ USER_PASSWORD_RESET_REQUESTED = "user.password_reset_requested".freeze
37
+ USER_EMAIL_VERIFIED = "user.email_verified".freeze
38
+ USER_PHONE_VERIFIED = "user.phone_verified".freeze
39
+ USER_DELETED = "user.deleted".freeze
40
+ USER_SESSION_REVOKED = "user.session_revoked".freeze
41
+ USER_MFA_ENABLED = "user.mfa_enabled".freeze
42
+ USER_MFA_DISABLED = "user.mfa_disabled".freeze
43
+ USER_IMPERSONATED = "user.impersonated".freeze
44
+ DOMAIN_VERIFIED = "domain.verified".freeze
45
+ DOMAIN_VERIFICATION_FAILED = "domain.verification_failed".freeze
46
+
47
+ def self.all_vars
48
+ @all_vars ||= [EMAIL_QUEUED, EMAIL_SENT, EMAIL_DELIVERED, EMAIL_BOUNCED, EMAIL_SOFT_BOUNCED, EMAIL_COMPLAINED, EMAIL_OPENED, EMAIL_CLICKED, EMAIL_FAILED, 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
49
+ end
50
+
51
+ # Builds the enum from string
52
+ # @param [String] The enum value in the form of the string
53
+ # @return [String] The enum value
54
+ def self.build_from_hash(value)
55
+ new.build_from_hash(value)
56
+ end
57
+
58
+ # Builds the enum from string
59
+ # @param [String] The enum value in the form of the string
60
+ # @return [String] The enum value
61
+ def build_from_hash(value)
62
+ return value if WebhookEventType.all_vars.include?(value)
63
+ raise "Invalid ENUM value #{value} for class #WebhookEventType"
64
+ end
65
+ end
66
+ end
@@ -46,7 +46,7 @@ module Zyphr
46
46
  # Attribute type mapping.
47
47
  def self.openapi_types
48
48
  {
49
- :'event_types' => :'Array<String>',
49
+ :'event_types' => :'Array<WebhookEventType>',
50
50
  :'registry' => :'Array<Object>',
51
51
  :'categories' => :'Array<String>',
52
52
  :'api_version' => :'String'
@@ -23,6 +23,28 @@ module Zyphr
23
23
 
24
24
  attr_accessor :status
25
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
+
26
48
  # Attribute mapping from ruby-style variable name to JSON key.
27
49
  def self.attribute_map
28
50
  {
@@ -47,7 +69,7 @@ module Zyphr
47
69
  def self.openapi_types
48
70
  {
49
71
  :'delivery_id' => :'String',
50
- :'event_type' => :'String',
72
+ :'event_type' => :'WebhookEventType',
51
73
  :'payload' => :'Object',
52
74
  :'status' => :'String'
53
75
  }
data/lib/zyphr.rb CHANGED
@@ -27,6 +27,8 @@ require 'zyphr/models/add_workflow_step_request'
27
27
  require 'zyphr/models/api_error'
28
28
  require 'zyphr/models/api_error_error'
29
29
  require 'zyphr/models/api_error_meta'
30
+ require 'zyphr/models/application_self'
31
+ require 'zyphr/models/application_self_response'
30
32
  require 'zyphr/models/auth_email_template'
31
33
  require 'zyphr/models/auth_email_template_default'
32
34
  require 'zyphr/models/auth_email_template_default_response'
@@ -47,6 +49,7 @@ require 'zyphr/models/auth_email_type'
47
49
  require 'zyphr/models/auth_login_response'
48
50
  require 'zyphr/models/auth_login_result'
49
51
  require 'zyphr/models/auth_login_result_mfa_challenge'
52
+ require 'zyphr/models/auth_methods'
50
53
  require 'zyphr/models/auth_result'
51
54
  require 'zyphr/models/auth_result_response'
52
55
  require 'zyphr/models/auth_session'
@@ -62,6 +65,7 @@ require 'zyphr/models/bulk_upsert_auth_email_templates_response'
62
65
  require 'zyphr/models/category'
63
66
  require 'zyphr/models/category_list_response'
64
67
  require 'zyphr/models/category_response'
68
+ require 'zyphr/models/change_password_request'
65
69
  require 'zyphr/models/close_waa_s_endpoint_circuit200_response'
66
70
  require 'zyphr/models/close_waa_s_endpoint_circuit200_response_data'
67
71
  require 'zyphr/models/confirm_email_verification_request'
@@ -140,6 +144,7 @@ require 'zyphr/models/generate_subscriber_token_request'
140
144
  require 'zyphr/models/generate_waa_s_portal_token201_response'
141
145
  require 'zyphr/models/get_domain200_response'
142
146
  require 'zyphr/models/get_domain200_response_meta'
147
+ require 'zyphr/models/get_end_user_auth_methods200_response'
143
148
  require 'zyphr/models/get_end_user_by_id200_response'
144
149
  require 'zyphr/models/get_end_user_claims200_response'
145
150
  require 'zyphr/models/get_end_user_claims200_response_data'
@@ -340,6 +345,7 @@ require 'zyphr/models/set_end_user_claims200_response_data'
340
345
  require 'zyphr/models/set_end_user_claims_request'
341
346
  require 'zyphr/models/set_preferences_request'
342
347
  require 'zyphr/models/set_preferences_request_preferences_inner'
348
+ require 'zyphr/models/set_self_application_test_recipients_request'
343
349
  require 'zyphr/models/sign_in_anonymously_request'
344
350
  require 'zyphr/models/sign_in_with_game_center_request'
345
351
  require 'zyphr/models/sign_in_with_google_play_games_request'
@@ -477,6 +483,7 @@ require 'zyphr/models/webhook_delivery_list_response'
477
483
  require 'zyphr/models/webhook_delivery_response'
478
484
  require 'zyphr/models/webhook_delivery_retry_response'
479
485
  require 'zyphr/models/webhook_delivery_retry_response_data'
486
+ require 'zyphr/models/webhook_event_type'
480
487
  require 'zyphr/models/webhook_event_types_response'
481
488
  require 'zyphr/models/webhook_event_types_response_data'
482
489
  require 'zyphr/models/webhook_ips_response'
@@ -509,6 +516,7 @@ require 'zyphr/models/workflow_step_execution_status'
509
516
  require 'zyphr/models/workflow_step_type'
510
517
 
511
518
  # APIs
519
+ require 'zyphr/api/auth_application_api'
512
520
  require 'zyphr/api/auth_email_otp_api'
513
521
  require 'zyphr/api/auth_email_templates_api'
514
522
  require 'zyphr/api/auth_email_verification_api'