zyphr 0.1.70 → 0.1.72
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.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/docs/CreateInboxRequest.md +24 -0
- data/docs/InboundEmail.md +2 -0
- data/docs/InboundEmailApi.md +432 -0
- data/docs/Inbox.md +30 -0
- data/docs/InboxResponse.md +20 -0
- data/docs/ReplyToInboundEmailRequest.md +34 -0
- data/docs/SendEmailRequest.md +4 -0
- data/docs/SlackApi.md +1 -1
- data/docs/UpdateInboxRequest.md +20 -0
- data/lib/zyphr/api/inbound_email_api.rb +396 -0
- data/lib/zyphr/api/slack_api.rb +2 -2
- data/lib/zyphr/models/create_inbox_request.rb +328 -0
- data/lib/zyphr/models/inbound_email.rb +12 -1
- data/lib/zyphr/models/inbox.rb +278 -0
- data/lib/zyphr/models/inbox_response.rb +229 -0
- data/lib/zyphr/models/reply_to_inbound_email_request.rb +350 -0
- data/lib/zyphr/models/send_email_request.rb +61 -1
- data/lib/zyphr/models/update_inbox_request.rb +264 -0
- data/lib/zyphr.rb +5 -0
- data/spec/api/inbound_email_api_spec.rb +72 -0
- data/spec/api/slack_api_spec.rb +1 -1
- data/spec/models/create_inbox_request_spec.rb +54 -0
- data/spec/models/inbound_email_spec.rb +6 -0
- data/spec/models/inbox_response_spec.rb +42 -0
- data/spec/models/inbox_spec.rb +72 -0
- data/spec/models/reply_to_inbound_email_request_spec.rb +88 -0
- data/spec/models/send_email_request_spec.rb +12 -0
- data/spec/models/update_inbox_request_spec.rb +42 -0
- data/zyphr.gemspec +1 -1
- metadata +22 -2
|
@@ -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 UpdateInboxRequest
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
attr_accessor :from_name
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'name' => :'name',
|
|
26
|
+
:'from_name' => :'from_name'
|
|
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
|
+
:'from_name' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
:'from_name'
|
|
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::UpdateInboxRequest` 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::UpdateInboxRequest`. 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?(:'from_name')
|
|
76
|
+
self.from_name = attributes[:'from_name']
|
|
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 !@from_name.nil? && @from_name.to_s.length > 78
|
|
90
|
+
invalid_properties.push('invalid value for "from_name", the character length must be smaller than or equal to 78.')
|
|
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 !@from_name.nil? && @from_name.to_s.length > 78
|
|
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] from_name Value to be assigned
|
|
121
|
+
def from_name=(from_name)
|
|
122
|
+
if !from_name.nil? && from_name.to_s.length > 78
|
|
123
|
+
fail ArgumentError, 'invalid value for "from_name", the character length must be smaller than or equal to 78.'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
@from_name = from_name
|
|
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
|
+
from_name == o.from_name
|
|
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, from_name].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
|
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_request'
|
|
87
88
|
require 'zyphr/models/create_organization_request'
|
|
88
89
|
require 'zyphr/models/create_subscriber_request'
|
|
89
90
|
require 'zyphr/models/create_template_request'
|
|
@@ -176,9 +177,11 @@ require 'zyphr/models/inbound_email_from'
|
|
|
176
177
|
require 'zyphr/models/inbound_email_list_response'
|
|
177
178
|
require 'zyphr/models/inbound_email_list_response_meta'
|
|
178
179
|
require 'zyphr/models/inbound_email_response'
|
|
180
|
+
require 'zyphr/models/inbox'
|
|
179
181
|
require 'zyphr/models/inbox_list_meta'
|
|
180
182
|
require 'zyphr/models/inbox_list_response'
|
|
181
183
|
require 'zyphr/models/inbox_notification_response'
|
|
184
|
+
require 'zyphr/models/inbox_response'
|
|
182
185
|
require 'zyphr/models/invite_end_user200_response'
|
|
183
186
|
require 'zyphr/models/invite_end_user200_response_data'
|
|
184
187
|
require 'zyphr/models/invite_end_user_request'
|
|
@@ -297,6 +300,7 @@ require 'zyphr/models/rename_web_authn_credential_request'
|
|
|
297
300
|
require 'zyphr/models/render_template_request'
|
|
298
301
|
require 'zyphr/models/reorder_workflow_steps_request'
|
|
299
302
|
require 'zyphr/models/replay_webhook_events_request'
|
|
303
|
+
require 'zyphr/models/reply_to_inbound_email_request'
|
|
300
304
|
require 'zyphr/models/request_meta'
|
|
301
305
|
require 'zyphr/models/resend_email_verification_request'
|
|
302
306
|
require 'zyphr/models/reset_password_request'
|
|
@@ -420,6 +424,7 @@ require 'zyphr/models/unsubscribe_response'
|
|
|
420
424
|
require 'zyphr/models/update_category_request'
|
|
421
425
|
require 'zyphr/models/update_end_user_by_application_request'
|
|
422
426
|
require 'zyphr/models/update_end_user_request'
|
|
427
|
+
require 'zyphr/models/update_inbox_request'
|
|
423
428
|
require 'zyphr/models/update_organization_member_role_request'
|
|
424
429
|
require 'zyphr/models/update_organization_request'
|
|
425
430
|
require 'zyphr/models/update_subscriber_preferences200_response'
|
|
@@ -32,6 +32,30 @@ describe 'InboundEmailApi' do
|
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# unit tests for create_inbox
|
|
36
|
+
# Create an inbox
|
|
37
|
+
# Create a named receiving address, `<local_part>@inbound.<domain>`, on a domain with inbound email enabled. Test-mode keys cannot create, update or delete inboxes, because inboxes change live mail routing. Once a domain has at least one inbox, mail to any other address on it is dropped; a domain with no inboxes keeps receiving at every address. Requires a plan with inbound email (Starter or higher).
|
|
38
|
+
# @param create_inbox_request
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [InboxResponse]
|
|
41
|
+
describe 'create_inbox test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for delete_inbox
|
|
48
|
+
# Delete an inbox
|
|
49
|
+
# Delete the inbox. Mail it already received is kept (its `inbox_id` becomes null). If it was the domain's last inbox, the domain goes back to receiving at every address.
|
|
50
|
+
# @param id
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @return [nil]
|
|
53
|
+
describe 'delete_inbox test' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
35
59
|
# unit tests for get_inbound_attachment_url
|
|
36
60
|
# Get an attachment download URL
|
|
37
61
|
# Return a short-lived presigned S3 download URL for one attachment of a received email. `attachmentId` is the positional id from the email's `attachments` array.
|
|
@@ -57,6 +81,17 @@ describe 'InboundEmailApi' do
|
|
|
57
81
|
end
|
|
58
82
|
end
|
|
59
83
|
|
|
84
|
+
# unit tests for get_inbox
|
|
85
|
+
# Get an inbox
|
|
86
|
+
# @param id
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [InboxResponse]
|
|
89
|
+
describe 'get_inbox test' do
|
|
90
|
+
it 'should work' do
|
|
91
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
60
95
|
# unit tests for list_inbound_emails
|
|
61
96
|
# List received emails
|
|
62
97
|
# List inbound (received) emails for the project, newest first. By default only delivered mail (`received`/`processed`) is returned; pass `include_withheld=true` to also see quarantined/dropped.
|
|
@@ -73,4 +108,41 @@ describe 'InboundEmailApi' do
|
|
|
73
108
|
end
|
|
74
109
|
end
|
|
75
110
|
|
|
111
|
+
# unit tests for list_inboxes
|
|
112
|
+
# List inboxes
|
|
113
|
+
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @return [InboxListResponse]
|
|
115
|
+
describe 'list_inboxes test' do
|
|
116
|
+
it 'should work' do
|
|
117
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# unit tests for reply_to_inbound_email
|
|
122
|
+
# Reply to a received email
|
|
123
|
+
# Send a reply to a received email that threads under the original in the recipient's mail client. Zyphr sets `to` (the original sender), the `Re:` subject, and the `In-Reply-To` / `References` headers from the received email; any of those fields in the body are ignored. Everything else behaves exactly like `POST /emails` (`html`/`text`, `send_at`/`delay`, quotas, suppression). Templates are not supported, because a template's own subject would break threading. Quarantined or dropped mail cannot be replied to.
|
|
124
|
+
# @param id
|
|
125
|
+
# @param reply_to_inbound_email_request
|
|
126
|
+
# @param [Hash] opts the optional parameters
|
|
127
|
+
# @option opts [String] :idempotency_key
|
|
128
|
+
# @return [SendEmailResponse]
|
|
129
|
+
describe 'reply_to_inbound_email test' do
|
|
130
|
+
it 'should work' do
|
|
131
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# unit tests for update_inbox
|
|
136
|
+
# Update an inbox
|
|
137
|
+
# Rename the inbox or change the display name recipients see. The address cannot change.
|
|
138
|
+
# @param id
|
|
139
|
+
# @param update_inbox_request
|
|
140
|
+
# @param [Hash] opts the optional parameters
|
|
141
|
+
# @return [InboxResponse]
|
|
142
|
+
describe 'update_inbox test' do
|
|
143
|
+
it 'should work' do
|
|
144
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
76
148
|
end
|
data/spec/api/slack_api_spec.rb
CHANGED
|
@@ -62,7 +62,7 @@ describe 'SlackApi' do
|
|
|
62
62
|
|
|
63
63
|
# unit tests for send_slack_message
|
|
64
64
|
# Send a Slack message
|
|
65
|
-
#
|
|
65
|
+
# Queue a message to a Slack channel through a connected Slack workspace. Either `text` or `blocks` must be provided. If `connection_id` is omitted, the project's active Slack connection is used. If `channel` is omitted, the connection's default channel is used. The message is accepted with status `queued` and delivered asynchronously, with retries on transient Slack errors and rate limits. Poll `GET /slack/messages/{id}` for the outcome: `sent`, with `message_ts`, or `failed`, with the reason.
|
|
66
66
|
# @param send_slack_message_request
|
|
67
67
|
# @param [Hash] opts the optional parameters
|
|
68
68
|
# @return [SendSlackMessageResponse]
|
|
@@ -0,0 +1,54 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::CreateInboxRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::CreateInboxRequest do
|
|
21
|
+
let(:instance) { Zyphr::CreateInboxRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CreateInboxRequest' do
|
|
24
|
+
it 'should create an instance of CreateInboxRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::CreateInboxRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "domain_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "local_part"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "name"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "from_name"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
@@ -39,6 +39,12 @@ describe Zyphr::InboundEmail do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
describe 'test attribute "inbox_id"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
42
48
|
describe 'test attribute "from"' do
|
|
43
49
|
it 'should work' do
|
|
44
50
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::InboxResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::InboxResponse do
|
|
21
|
+
let(:instance) { Zyphr::InboxResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of InboxResponse' do
|
|
24
|
+
it 'should create an instance of InboxResponse' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::InboxResponse)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "data"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "meta"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zyphr::Inbox
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::Inbox do
|
|
21
|
+
let(:instance) { Zyphr::Inbox.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of Inbox' do
|
|
24
|
+
it 'should create an instance of Inbox' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::Inbox)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "email_address"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "domain_id"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "name"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "from_name"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "created_at"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
describe 'test attribute "updated_at"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
end
|