zyphr 0.1.43 → 0.1.44

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.
@@ -0,0 +1,376 @@
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
+ # Aggregate view of the sign-in methods configured for a single end user, for building a customer \"sign-in methods\" screen.
18
+ class AuthMethods
19
+ # True if the user has a password credential (false for OAuth-only / passwordless users).
20
+ attr_accessor :has_password
21
+
22
+ # Distinct OAuth providers linked to the user (e.g. google, apple).
23
+ attr_accessor :oauth_providers
24
+
25
+ # True if the user has multi-factor authentication enabled.
26
+ attr_accessor :mfa_enabled
27
+
28
+ # True if the user's email address has been verified.
29
+ attr_accessor :email_verified
30
+
31
+ # True if the user's phone number has been verified.
32
+ attr_accessor :phone_verified
33
+
34
+ # Number of WebAuthn passkeys registered for the user.
35
+ attr_accessor :passkeys
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'has_password' => :'has_password',
41
+ :'oauth_providers' => :'oauth_providers',
42
+ :'mfa_enabled' => :'mfa_enabled',
43
+ :'email_verified' => :'email_verified',
44
+ :'phone_verified' => :'phone_verified',
45
+ :'passkeys' => :'passkeys'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'has_password' => :'Boolean',
63
+ :'oauth_providers' => :'Array<String>',
64
+ :'mfa_enabled' => :'Boolean',
65
+ :'email_verified' => :'Boolean',
66
+ :'phone_verified' => :'Boolean',
67
+ :'passkeys' => :'Integer'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::AuthMethods` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::AuthMethods`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'has_password')
94
+ self.has_password = attributes[:'has_password']
95
+ else
96
+ self.has_password = nil
97
+ end
98
+
99
+ if attributes.key?(:'oauth_providers')
100
+ if (value = attributes[:'oauth_providers']).is_a?(Array)
101
+ self.oauth_providers = value
102
+ end
103
+ else
104
+ self.oauth_providers = nil
105
+ end
106
+
107
+ if attributes.key?(:'mfa_enabled')
108
+ self.mfa_enabled = attributes[:'mfa_enabled']
109
+ else
110
+ self.mfa_enabled = nil
111
+ end
112
+
113
+ if attributes.key?(:'email_verified')
114
+ self.email_verified = attributes[:'email_verified']
115
+ else
116
+ self.email_verified = nil
117
+ end
118
+
119
+ if attributes.key?(:'phone_verified')
120
+ self.phone_verified = attributes[:'phone_verified']
121
+ else
122
+ self.phone_verified = nil
123
+ end
124
+
125
+ if attributes.key?(:'passkeys')
126
+ self.passkeys = attributes[:'passkeys']
127
+ else
128
+ self.passkeys = nil
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if @has_password.nil?
138
+ invalid_properties.push('invalid value for "has_password", has_password cannot be nil.')
139
+ end
140
+
141
+ if @oauth_providers.nil?
142
+ invalid_properties.push('invalid value for "oauth_providers", oauth_providers cannot be nil.')
143
+ end
144
+
145
+ if @mfa_enabled.nil?
146
+ invalid_properties.push('invalid value for "mfa_enabled", mfa_enabled cannot be nil.')
147
+ end
148
+
149
+ if @email_verified.nil?
150
+ invalid_properties.push('invalid value for "email_verified", email_verified cannot be nil.')
151
+ end
152
+
153
+ if @phone_verified.nil?
154
+ invalid_properties.push('invalid value for "phone_verified", phone_verified cannot be nil.')
155
+ end
156
+
157
+ if @passkeys.nil?
158
+ invalid_properties.push('invalid value for "passkeys", passkeys cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ return false if @has_password.nil?
169
+ return false if @oauth_providers.nil?
170
+ return false if @mfa_enabled.nil?
171
+ return false if @email_verified.nil?
172
+ return false if @phone_verified.nil?
173
+ return false if @passkeys.nil?
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] has_password Value to be assigned
179
+ def has_password=(has_password)
180
+ if has_password.nil?
181
+ fail ArgumentError, 'has_password cannot be nil'
182
+ end
183
+
184
+ @has_password = has_password
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] oauth_providers Value to be assigned
189
+ def oauth_providers=(oauth_providers)
190
+ if oauth_providers.nil?
191
+ fail ArgumentError, 'oauth_providers cannot be nil'
192
+ end
193
+
194
+ @oauth_providers = oauth_providers
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] mfa_enabled Value to be assigned
199
+ def mfa_enabled=(mfa_enabled)
200
+ if mfa_enabled.nil?
201
+ fail ArgumentError, 'mfa_enabled cannot be nil'
202
+ end
203
+
204
+ @mfa_enabled = mfa_enabled
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] email_verified Value to be assigned
209
+ def email_verified=(email_verified)
210
+ if email_verified.nil?
211
+ fail ArgumentError, 'email_verified cannot be nil'
212
+ end
213
+
214
+ @email_verified = email_verified
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] phone_verified Value to be assigned
219
+ def phone_verified=(phone_verified)
220
+ if phone_verified.nil?
221
+ fail ArgumentError, 'phone_verified cannot be nil'
222
+ end
223
+
224
+ @phone_verified = phone_verified
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] passkeys Value to be assigned
229
+ def passkeys=(passkeys)
230
+ if passkeys.nil?
231
+ fail ArgumentError, 'passkeys cannot be nil'
232
+ end
233
+
234
+ @passkeys = passkeys
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ has_password == o.has_password &&
243
+ oauth_providers == o.oauth_providers &&
244
+ mfa_enabled == o.mfa_enabled &&
245
+ email_verified == o.email_verified &&
246
+ phone_verified == o.phone_verified &&
247
+ passkeys == o.passkeys
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [has_password, oauth_providers, mfa_enabled, email_verified, phone_verified, passkeys].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ transformed_hash = {}
269
+ openapi_types.each_pair do |key, type|
270
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
271
+ transformed_hash["#{key}"] = nil
272
+ elsif type =~ /\AArray<(.*)>/i
273
+ # check to ensure the input is an array given that the attribute
274
+ # is documented as an array but the input is not
275
+ if attributes[attribute_map[key]].is_a?(Array)
276
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
277
+ end
278
+ elsif !attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
280
+ end
281
+ end
282
+ new(transformed_hash)
283
+ end
284
+
285
+ # Deserializes the data based on type
286
+ # @param string type Data type
287
+ # @param string value Value to be deserialized
288
+ # @return [Object] Deserialized data
289
+ def self._deserialize(type, value)
290
+ case type.to_sym
291
+ when :Time
292
+ Time.parse(value)
293
+ when :Date
294
+ Date.parse(value)
295
+ when :String
296
+ value.to_s
297
+ when :Integer
298
+ value.to_i
299
+ when :Float
300
+ value.to_f
301
+ when :Boolean
302
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
303
+ true
304
+ else
305
+ false
306
+ end
307
+ when :Object
308
+ # generic object (usually a Hash), return directly
309
+ value
310
+ when /\AArray<(?<inner_type>.+)>\z/
311
+ inner_type = Regexp.last_match[:inner_type]
312
+ value.map { |v| _deserialize(inner_type, v) }
313
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
314
+ k_type = Regexp.last_match[:k_type]
315
+ v_type = Regexp.last_match[:v_type]
316
+ {}.tap do |hash|
317
+ value.each do |k, v|
318
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
319
+ end
320
+ end
321
+ else # model
322
+ # models (e.g. Pet) or oneOf
323
+ klass = Zyphr.const_get(type)
324
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
325
+ end
326
+ end
327
+
328
+ # Returns the string representation of the object
329
+ # @return [String] String presentation of the object
330
+ def to_s
331
+ to_hash.to_s
332
+ end
333
+
334
+ # to_body is an alias to to_hash (backward compatibility)
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_body
337
+ to_hash
338
+ end
339
+
340
+ # Returns the object in the form of hash
341
+ # @return [Hash] Returns the object in the form of hash
342
+ def to_hash
343
+ hash = {}
344
+ self.class.attribute_map.each_pair do |attr, param|
345
+ value = self.send(attr)
346
+ if value.nil?
347
+ is_nullable = self.class.openapi_nullable.include?(attr)
348
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
349
+ end
350
+
351
+ hash[param] = _to_hash(value)
352
+ end
353
+ hash
354
+ end
355
+
356
+ # Outputs non-array value in the form of hash
357
+ # For object, use to_hash. Otherwise, just return the value
358
+ # @param [Object] value Any valid value
359
+ # @return [Hash] Returns the value in the form of hash
360
+ def _to_hash(value)
361
+ if value.is_a?(Array)
362
+ value.compact.map { |v| _to_hash(v) }
363
+ elsif value.is_a?(Hash)
364
+ {}.tap do |hash|
365
+ value.each { |k, v| hash[k] = _to_hash(v) }
366
+ end
367
+ elsif value.respond_to? :to_hash
368
+ value.to_hash
369
+ else
370
+ value
371
+ end
372
+ end
373
+
374
+ end
375
+
376
+ end
@@ -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
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'
@@ -140,6 +143,7 @@ require 'zyphr/models/generate_subscriber_token_request'
140
143
  require 'zyphr/models/generate_waa_s_portal_token201_response'
141
144
  require 'zyphr/models/get_domain200_response'
142
145
  require 'zyphr/models/get_domain200_response_meta'
146
+ require 'zyphr/models/get_end_user_auth_methods200_response'
143
147
  require 'zyphr/models/get_end_user_by_id200_response'
144
148
  require 'zyphr/models/get_end_user_claims200_response'
145
149
  require 'zyphr/models/get_end_user_claims200_response_data'
@@ -509,6 +513,7 @@ require 'zyphr/models/workflow_step_execution_status'
509
513
  require 'zyphr/models/workflow_step_type'
510
514
 
511
515
  # APIs
516
+ require 'zyphr/api/auth_application_api'
512
517
  require 'zyphr/api/auth_email_otp_api'
513
518
  require 'zyphr/api/auth_email_templates_api'
514
519
  require 'zyphr/api/auth_email_verification_api'
@@ -0,0 +1,46 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Zyphr::AuthApplicationApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AuthApplicationApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = Zyphr::AuthApplicationApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AuthApplicationApi' do
30
+ it 'should create an instance of AuthApplicationApi' do
31
+ expect(@api_instance).to be_instance_of(Zyphr::AuthApplicationApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_self_application
36
+ # Get the authenticating application
37
+ # Return non-sensitive metadata about the application whose credentials authenticated this request. Lets an integrator read their own application_id (the sole tenant discriminator embedded in every end-user token) directly from the API, rather than only from the dashboard UI or by decoding a token. Returns only id, name, the calling environment&#39;s mode, and the JWT signing algorithm — never secrets, signing keys, or account-internal fields.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [ApplicationSelfResponse]
40
+ describe 'get_self_application test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
43
+ end
44
+ end
45
+
46
+ end
@@ -130,7 +130,7 @@ describe 'AuthEmailTemplatesApi' do
130
130
 
131
131
  # unit tests for send_auth_email_template_test
132
132
  # Send a test render of a template
133
- # Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application &#x60;test_recipients&#x60; allowlist. Rate-limited.
133
+ # Renders the template (override or default) using sample/provided variables and sends to the recipient. The recipient must be in the application &#x60;test_recipients&#x60; allowlist. Rate-limited. When non-empty, &#x60;test_recipients&#x60; gates ALL auth emails this application sends (magic link, password reset, email verification, and email OTP) — not just these test renders. Only listed recipients receive auth email; any other recipient is silently blocked. Use it to make a non-production application safe from mass sends. An empty allowlist (the default) imposes no restriction and every recipient receives auth email normally.
134
134
  # @param type
135
135
  # @param auth_email_template_test_request
136
136
  # @param [Hash] opts the optional parameters