zyphr 0.1.68 → 0.1.69

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -0
  3. data/docs/AuthMagicLinksApi.md +5 -5
  4. data/docs/AuthPasswordResetApi.md +5 -5
  5. data/docs/AuthUserDirectoryApi.md +1 -1
  6. data/docs/ForgotPasswordRequest.md +3 -1
  7. data/docs/ForgotPasswordResult.md +20 -0
  8. data/docs/ForgotPasswordResultData.md +22 -0
  9. data/docs/InviteEndUser200ResponseData.md +2 -0
  10. data/docs/InviteEndUserRequest.md +3 -1
  11. data/docs/MagicLinkSendRequest.md +3 -1
  12. data/docs/MagicLinkSendResult.md +20 -0
  13. data/docs/MagicLinkSendResultData.md +20 -0
  14. data/docs/ReturnedAuthLink.md +22 -0
  15. data/lib/zyphr/api/auth_magic_links_api.rb +5 -5
  16. data/lib/zyphr/api/auth_password_reset_api.rb +5 -5
  17. data/lib/zyphr/api/auth_user_directory_api.rb +2 -2
  18. data/lib/zyphr/models/forgot_password_request.rb +16 -4
  19. data/lib/zyphr/models/forgot_password_result.rb +229 -0
  20. data/lib/zyphr/models/forgot_password_result_data.rb +275 -0
  21. data/lib/zyphr/models/invite_end_user200_response_data.rb +10 -1
  22. data/lib/zyphr/models/invite_end_user_request.rb +16 -4
  23. data/lib/zyphr/models/magic_link_send_request.rb +16 -4
  24. data/lib/zyphr/models/magic_link_send_result.rb +229 -0
  25. data/lib/zyphr/models/magic_link_send_result_data.rb +229 -0
  26. data/lib/zyphr/models/returned_auth_link.rb +292 -0
  27. data/lib/zyphr.rb +5 -0
  28. data/spec/api/auth_magic_links_api_spec.rb +2 -2
  29. data/spec/api/auth_password_reset_api_spec.rb +2 -2
  30. data/spec/api/auth_user_directory_api_spec.rb +1 -1
  31. data/spec/models/forgot_password_request_spec.rb +6 -0
  32. data/spec/models/forgot_password_result_data_spec.rb +52 -0
  33. data/spec/models/forgot_password_result_spec.rb +42 -0
  34. data/spec/models/invite_end_user200_response_data_spec.rb +6 -0
  35. data/spec/models/invite_end_user_request_spec.rb +6 -0
  36. data/spec/models/magic_link_send_request_spec.rb +6 -0
  37. data/spec/models/magic_link_send_result_data_spec.rb +42 -0
  38. data/spec/models/magic_link_send_result_spec.rb +42 -0
  39. data/spec/models/returned_auth_link_spec.rb +48 -0
  40. data/zyphr.gemspec +1 -1
  41. metadata +22 -2
@@ -0,0 +1,229 @@
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 ForgotPasswordResult
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' => :'ForgotPasswordResultData',
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::ForgotPasswordResult` 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::ForgotPasswordResult`. 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,275 @@
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 ForgotPasswordResultData
18
+ attr_accessor :success
19
+
20
+ # Present only when `return_link` was true; null when no link was minted.
21
+ attr_accessor :link
22
+
23
+ # Present only when `return_link` was true and `link` is null.
24
+ attr_accessor :link_suppressed_reason
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
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'success' => :'success',
52
+ :'link' => :'link',
53
+ :'link_suppressed_reason' => :'link_suppressed_reason'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'success' => :'Boolean',
71
+ :'link' => :'ReturnedAuthLink',
72
+ :'link_suppressed_reason' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ :'link',
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::ForgotPasswordResultData` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::ForgotPasswordResultData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'success')
100
+ self.success = attributes[:'success']
101
+ end
102
+
103
+ if attributes.key?(:'link')
104
+ self.link = attributes[:'link']
105
+ end
106
+
107
+ if attributes.key?(:'link_suppressed_reason')
108
+ self.link_suppressed_reason = attributes[:'link_suppressed_reason']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ link_suppressed_reason_validator = EnumAttributeValidator.new('String', ["user_not_found", "identity_has_other_auth_methods"])
125
+ return false unless link_suppressed_reason_validator.valid?(@link_suppressed_reason)
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method checking allowed values (enum).
130
+ # @param [Object] link_suppressed_reason Object to be assigned
131
+ def link_suppressed_reason=(link_suppressed_reason)
132
+ validator = EnumAttributeValidator.new('String', ["user_not_found", "identity_has_other_auth_methods"])
133
+ unless validator.valid?(link_suppressed_reason)
134
+ fail ArgumentError, "invalid value for \"link_suppressed_reason\", must be one of #{validator.allowable_values}."
135
+ end
136
+ @link_suppressed_reason = link_suppressed_reason
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ success == o.success &&
145
+ link == o.link &&
146
+ link_suppressed_reason == o.link_suppressed_reason
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [success, link, link_suppressed_reason].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Deserializes the data based on type
185
+ # @param string type Data type
186
+ # @param string value Value to be deserialized
187
+ # @return [Object] Deserialized data
188
+ def self._deserialize(type, value)
189
+ case type.to_sym
190
+ when :Time
191
+ Time.parse(value)
192
+ when :Date
193
+ Date.parse(value)
194
+ when :String
195
+ value.to_s
196
+ when :Integer
197
+ value.to_i
198
+ when :Float
199
+ value.to_f
200
+ when :Boolean
201
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
202
+ true
203
+ else
204
+ false
205
+ end
206
+ when :Object
207
+ # generic object (usually a Hash), return directly
208
+ value
209
+ when /\AArray<(?<inner_type>.+)>\z/
210
+ inner_type = Regexp.last_match[:inner_type]
211
+ value.map { |v| _deserialize(inner_type, v) }
212
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
213
+ k_type = Regexp.last_match[:k_type]
214
+ v_type = Regexp.last_match[:v_type]
215
+ {}.tap do |hash|
216
+ value.each do |k, v|
217
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
218
+ end
219
+ end
220
+ else # model
221
+ # models (e.g. Pet) or oneOf
222
+ klass = Zyphr.const_get(type)
223
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
224
+ end
225
+ end
226
+
227
+ # Returns the string representation of the object
228
+ # @return [String] String presentation of the object
229
+ def to_s
230
+ to_hash.to_s
231
+ end
232
+
233
+ # to_body is an alias to to_hash (backward compatibility)
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_body
236
+ to_hash
237
+ end
238
+
239
+ # Returns the object in the form of hash
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_hash
242
+ hash = {}
243
+ self.class.attribute_map.each_pair do |attr, param|
244
+ value = self.send(attr)
245
+ if value.nil?
246
+ is_nullable = self.class.openapi_nullable.include?(attr)
247
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
248
+ end
249
+
250
+ hash[param] = _to_hash(value)
251
+ end
252
+ hash
253
+ end
254
+
255
+ # Outputs non-array value in the form of hash
256
+ # For object, use to_hash. Otherwise, just return the value
257
+ # @param [Object] value Any valid value
258
+ # @return [Hash] Returns the value in the form of hash
259
+ def _to_hash(value)
260
+ if value.is_a?(Array)
261
+ value.compact.map { |v| _to_hash(v) }
262
+ elsif value.is_a?(Hash)
263
+ {}.tap do |hash|
264
+ value.each { |k, v| hash[k] = _to_hash(v) }
265
+ end
266
+ elsif value.respond_to? :to_hash
267
+ value.to_hash
268
+ else
269
+ value
270
+ end
271
+ end
272
+
273
+ end
274
+
275
+ end
@@ -23,6 +23,8 @@ module Zyphr
23
23
  # True when the requested invitation, magic-link or password-reset email was successfully dispatched.
24
24
  attr_accessor :link_sent
25
25
 
26
+ attr_accessor :link
27
+
26
28
  # Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. (For `send_link: \"invitation\"` the reason is returned here only; no suppressed message is recorded.) - `user_has_password` — `send_link: \"invitation\"` only: the identity already has a password, so there is nothing to accept. Use `password_reset` to send a reset. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error.
27
29
  attr_accessor :link_suppressed_reason
28
30
 
@@ -32,6 +34,7 @@ module Zyphr
32
34
  :'user_id' => :'user_id',
33
35
  :'created' => :'created',
34
36
  :'link_sent' => :'link_sent',
37
+ :'link' => :'link',
35
38
  :'link_suppressed_reason' => :'link_suppressed_reason'
36
39
  }
37
40
  end
@@ -52,6 +55,7 @@ module Zyphr
52
55
  :'user_id' => :'String',
53
56
  :'created' => :'Boolean',
54
57
  :'link_sent' => :'Boolean',
58
+ :'link' => :'ReturnedAuthLink',
55
59
  :'link_suppressed_reason' => :'String'
56
60
  }
57
61
  end
@@ -90,6 +94,10 @@ module Zyphr
90
94
  self.link_sent = attributes[:'link_sent']
91
95
  end
92
96
 
97
+ if attributes.key?(:'link')
98
+ self.link = attributes[:'link']
99
+ end
100
+
93
101
  if attributes.key?(:'link_suppressed_reason')
94
102
  self.link_suppressed_reason = attributes[:'link_suppressed_reason']
95
103
  end
@@ -118,6 +126,7 @@ module Zyphr
118
126
  user_id == o.user_id &&
119
127
  created == o.created &&
120
128
  link_sent == o.link_sent &&
129
+ link == o.link &&
121
130
  link_suppressed_reason == o.link_suppressed_reason
122
131
  end
123
132
 
@@ -130,7 +139,7 @@ module Zyphr
130
139
  # Calculates hash code according to all attributes.
131
140
  # @return [Integer] Hash code
132
141
  def hash
133
- [user_id, created, link_sent, link_suppressed_reason].hash
142
+ [user_id, created, link_sent, link, link_suppressed_reason].hash
134
143
  end
135
144
 
136
145
  # Builds the object from hash
@@ -25,6 +25,9 @@ module Zyphr
25
25
 
26
26
  attr_accessor :redirect_url
27
27
 
28
+ # Return the link in `data.link` instead of emailing it. Requires `send_link` other than \"none\".
29
+ attr_accessor :return_link
30
+
28
31
  class EnumAttributeValidator
29
32
  attr_reader :datatype
30
33
  attr_reader :allowable_values
@@ -54,7 +57,8 @@ module Zyphr
54
57
  :'name' => :'name',
55
58
  :'metadata' => :'metadata',
56
59
  :'send_link' => :'send_link',
57
- :'redirect_url' => :'redirect_url'
60
+ :'redirect_url' => :'redirect_url',
61
+ :'return_link' => :'return_link'
58
62
  }
59
63
  end
60
64
 
@@ -75,7 +79,8 @@ module Zyphr
75
79
  :'name' => :'String',
76
80
  :'metadata' => :'Object',
77
81
  :'send_link' => :'String',
78
- :'redirect_url' => :'String'
82
+ :'redirect_url' => :'String',
83
+ :'return_link' => :'Boolean'
79
84
  }
80
85
  end
81
86
 
@@ -124,6 +129,12 @@ module Zyphr
124
129
  if attributes.key?(:'redirect_url')
125
130
  self.redirect_url = attributes[:'redirect_url']
126
131
  end
132
+
133
+ if attributes.key?(:'return_link')
134
+ self.return_link = attributes[:'return_link']
135
+ else
136
+ self.return_link = false
137
+ end
127
138
  end
128
139
 
129
140
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -177,7 +188,8 @@ module Zyphr
177
188
  name == o.name &&
178
189
  metadata == o.metadata &&
179
190
  send_link == o.send_link &&
180
- redirect_url == o.redirect_url
191
+ redirect_url == o.redirect_url &&
192
+ return_link == o.return_link
181
193
  end
182
194
 
183
195
  # @see the `==` method
@@ -189,7 +201,7 @@ module Zyphr
189
201
  # Calculates hash code according to all attributes.
190
202
  # @return [Integer] Hash code
191
203
  def hash
192
- [email, name, metadata, send_link, redirect_url].hash
204
+ [email, name, metadata, send_link, redirect_url, return_link].hash
193
205
  end
194
206
 
195
207
  # Builds the object from hash
@@ -19,11 +19,15 @@ module Zyphr
19
19
 
20
20
  attr_accessor :redirect_url
21
21
 
22
+ # When true, Zyphr mints the token but sends no email, and returns the link in `data.link` so you can render and send the email yourself (for example through `POST /v1/emails`). Requires `redirect_url`.
23
+ attr_accessor :return_link
24
+
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
23
26
  def self.attribute_map
24
27
  {
25
28
  :'email' => :'email',
26
- :'redirect_url' => :'redirect_url'
29
+ :'redirect_url' => :'redirect_url',
30
+ :'return_link' => :'return_link'
27
31
  }
28
32
  end
29
33
 
@@ -41,7 +45,8 @@ module Zyphr
41
45
  def self.openapi_types
42
46
  {
43
47
  :'email' => :'String',
44
- :'redirect_url' => :'String'
48
+ :'redirect_url' => :'String',
49
+ :'return_link' => :'Boolean'
45
50
  }
46
51
  end
47
52
 
@@ -76,6 +81,12 @@ module Zyphr
76
81
  if attributes.key?(:'redirect_url')
77
82
  self.redirect_url = attributes[:'redirect_url']
78
83
  end
84
+
85
+ if attributes.key?(:'return_link')
86
+ self.return_link = attributes[:'return_link']
87
+ else
88
+ self.return_link = false
89
+ end
79
90
  end
80
91
 
81
92
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -114,7 +125,8 @@ module Zyphr
114
125
  return true if self.equal?(o)
115
126
  self.class == o.class &&
116
127
  email == o.email &&
117
- redirect_url == o.redirect_url
128
+ redirect_url == o.redirect_url &&
129
+ return_link == o.return_link
118
130
  end
119
131
 
120
132
  # @see the `==` method
@@ -126,7 +138,7 @@ module Zyphr
126
138
  # Calculates hash code according to all attributes.
127
139
  # @return [Integer] Hash code
128
140
  def hash
129
- [email, redirect_url].hash
141
+ [email, redirect_url, return_link].hash
130
142
  end
131
143
 
132
144
  # Builds the object from hash