zyphr 0.1.32 → 0.1.34

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -0
  3. data/docs/AddOrganizationMemberRequest.md +20 -0
  4. data/docs/AuthOrganizationsApi.md +864 -0
  5. data/docs/AuthUserProfileApi.md +76 -0
  6. data/docs/CreateOrganizationRequest.md +22 -0
  7. data/docs/DomainsApi.md +73 -0
  8. data/docs/InboundAttachmentUrlResponse.md +20 -0
  9. data/docs/InboundAttachmentUrlResponseData.md +22 -0
  10. data/docs/InboundEmail.md +48 -0
  11. data/docs/InboundEmailApi.md +235 -0
  12. data/docs/InboundEmailAttachment.md +24 -0
  13. data/docs/InboundEmailFrom.md +20 -0
  14. data/docs/InboundEmailListResponse.md +20 -0
  15. data/docs/InboundEmailListResponseMeta.md +24 -0
  16. data/docs/InboundEmailResponse.md +20 -0
  17. data/docs/LoginRequest.md +3 -1
  18. data/docs/MuseApi.md +681 -0
  19. data/docs/Organization.md +34 -0
  20. data/docs/OrganizationListResponse.md +20 -0
  21. data/docs/OrganizationListResponseMeta.md +20 -0
  22. data/docs/OrganizationMembersListResponse.md +20 -0
  23. data/docs/OrganizationMembership.md +30 -0
  24. data/docs/OrganizationMembershipResponse.md +20 -0
  25. data/docs/OrganizationMembershipWithUser.md +34 -0
  26. data/docs/OrganizationResponse.md +20 -0
  27. data/docs/RegisterRequest.md +5 -1
  28. data/docs/SetDomainInboundRequest.md +18 -0
  29. data/docs/SwitchOrganizationRequest.md +20 -0
  30. data/docs/SwitchOrganizationResponse.md +20 -0
  31. data/docs/SwitchOrganizationResponseData.md +22 -0
  32. data/docs/SwitchOrganizationResponseDataTokens.md +24 -0
  33. data/docs/SwitchOrganizationResponseDataUser.md +20 -0
  34. data/docs/UpdateOrganizationMemberRoleRequest.md +18 -0
  35. data/docs/UpdateOrganizationRequest.md +22 -0
  36. data/docs/V1MuseSubjectsSuggestPostRequest.md +24 -0
  37. data/lib/zyphr/api/auth_organizations_api.rb +773 -0
  38. data/lib/zyphr/api/auth_user_profile_api.rb +61 -0
  39. data/lib/zyphr/api/domains_api.rb +72 -0
  40. data/lib/zyphr/api/inbound_email_api.rb +234 -0
  41. data/lib/zyphr/api/muse_api.rb +644 -0
  42. data/lib/zyphr/models/add_organization_member_request.rb +248 -0
  43. data/lib/zyphr/models/create_organization_request.rb +258 -0
  44. data/lib/zyphr/models/inbound_attachment_url_response.rb +229 -0
  45. data/lib/zyphr/models/inbound_attachment_url_response_data.rb +240 -0
  46. data/lib/zyphr/models/inbound_email.rb +441 -0
  47. data/lib/zyphr/models/inbound_email_attachment.rb +250 -0
  48. data/lib/zyphr/models/inbound_email_from.rb +230 -0
  49. data/lib/zyphr/models/inbound_email_list_response.rb +231 -0
  50. data/lib/zyphr/models/inbound_email_list_response_meta.rb +247 -0
  51. data/lib/zyphr/models/inbound_email_response.rb +229 -0
  52. data/lib/zyphr/models/login_request.rb +14 -4
  53. data/lib/zyphr/models/organization.rb +434 -0
  54. data/lib/zyphr/models/organization_list_response.rb +265 -0
  55. data/lib/zyphr/models/organization_list_response_meta.rb +230 -0
  56. data/lib/zyphr/models/organization_members_list_response.rb +265 -0
  57. data/lib/zyphr/models/organization_membership.rb +379 -0
  58. data/lib/zyphr/models/organization_membership_response.rb +263 -0
  59. data/lib/zyphr/models/organization_membership_with_user.rb +405 -0
  60. data/lib/zyphr/models/organization_response.rb +263 -0
  61. data/lib/zyphr/models/register_request.rb +43 -4
  62. data/lib/zyphr/models/set_domain_inbound_request.rb +220 -0
  63. data/lib/zyphr/models/switch_organization_request.rb +263 -0
  64. data/lib/zyphr/models/switch_organization_response.rb +263 -0
  65. data/lib/zyphr/models/switch_organization_response_data.rb +289 -0
  66. data/lib/zyphr/models/switch_organization_response_data_tokens.rb +339 -0
  67. data/lib/zyphr/models/switch_organization_response_data_user.rb +230 -0
  68. data/lib/zyphr/models/update_organization_member_role_request.rb +223 -0
  69. data/lib/zyphr/models/update_organization_request.rb +239 -0
  70. data/lib/zyphr/models/v1_muse_subjects_suggest_post_request.rb +326 -0
  71. data/lib/zyphr.rb +30 -0
  72. data/spec/api/auth_organizations_api_spec.rb +171 -0
  73. data/spec/api/auth_user_profile_api_spec.rb +12 -0
  74. data/spec/api/domains_api_spec.rb +13 -0
  75. data/spec/api/inbound_email_api_spec.rb +76 -0
  76. data/spec/api/muse_api_spec.rb +156 -0
  77. data/spec/models/add_organization_member_request_spec.rb +42 -0
  78. data/spec/models/create_organization_request_spec.rb +48 -0
  79. data/spec/models/inbound_attachment_url_response_data_spec.rb +48 -0
  80. data/spec/models/inbound_attachment_url_response_spec.rb +42 -0
  81. data/spec/models/inbound_email_attachment_spec.rb +54 -0
  82. data/spec/models/inbound_email_from_spec.rb +42 -0
  83. data/spec/models/inbound_email_list_response_meta_spec.rb +54 -0
  84. data/spec/models/inbound_email_list_response_spec.rb +42 -0
  85. data/spec/models/inbound_email_response_spec.rb +42 -0
  86. data/spec/models/inbound_email_spec.rb +142 -0
  87. data/spec/models/login_request_spec.rb +6 -0
  88. data/spec/models/organization_list_response_meta_spec.rb +42 -0
  89. data/spec/models/organization_list_response_spec.rb +42 -0
  90. data/spec/models/organization_members_list_response_spec.rb +42 -0
  91. data/spec/models/organization_membership_response_spec.rb +42 -0
  92. data/spec/models/organization_membership_spec.rb +72 -0
  93. data/spec/models/organization_membership_with_user_spec.rb +84 -0
  94. data/spec/models/organization_response_spec.rb +42 -0
  95. data/spec/models/organization_spec.rb +84 -0
  96. data/spec/models/register_request_spec.rb +12 -0
  97. data/spec/models/set_domain_inbound_request_spec.rb +36 -0
  98. data/spec/models/switch_organization_request_spec.rb +42 -0
  99. data/spec/models/switch_organization_response_data_spec.rb +48 -0
  100. data/spec/models/switch_organization_response_data_tokens_spec.rb +58 -0
  101. data/spec/models/switch_organization_response_data_user_spec.rb +42 -0
  102. data/spec/models/switch_organization_response_spec.rb +42 -0
  103. data/spec/models/update_organization_member_role_request_spec.rb +36 -0
  104. data/spec/models/update_organization_request_spec.rb +48 -0
  105. data/spec/models/v1_muse_subjects_suggest_post_request_spec.rb +58 -0
  106. data/zyphr.gemspec +1 -1
  107. metadata +122 -2
@@ -0,0 +1,326 @@
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 ## 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 V1MuseSubjectsSuggestPostRequest
18
+ # Optional template id. When provided, the route resolves the template body server-side. Cannot be combined with template_body.
19
+ attr_accessor :template_id
20
+
21
+ # Optional raw template body. Empty/missing is allowed — the prompt handles sparse input by falling back to channel best-practices.
22
+ attr_accessor :template_body
23
+
24
+ attr_accessor :channel
25
+
26
+ attr_accessor :project_id
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'template_id' => :'template_id',
54
+ :'template_body' => :'template_body',
55
+ :'channel' => :'channel',
56
+ :'project_id' => :'project_id'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'template_id' => :'String',
74
+ :'template_body' => :'String',
75
+ :'channel' => :'String',
76
+ :'project_id' => :'String'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::V1MuseSubjectsSuggestPostRequest` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::V1MuseSubjectsSuggestPostRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'template_id')
103
+ self.template_id = attributes[:'template_id']
104
+ end
105
+
106
+ if attributes.key?(:'template_body')
107
+ self.template_body = attributes[:'template_body']
108
+ end
109
+
110
+ if attributes.key?(:'channel')
111
+ self.channel = attributes[:'channel']
112
+ else
113
+ self.channel = nil
114
+ end
115
+
116
+ if attributes.key?(:'project_id')
117
+ self.project_id = attributes[:'project_id']
118
+ else
119
+ self.project_id = nil
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if !@template_body.nil? && @template_body.to_s.length > 50000
129
+ invalid_properties.push('invalid value for "template_body", the character length must be smaller than or equal to 50000.')
130
+ end
131
+
132
+ if @channel.nil?
133
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
134
+ end
135
+
136
+ if @project_id.nil?
137
+ invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if !@template_body.nil? && @template_body.to_s.length > 50000
148
+ return false if @channel.nil?
149
+ channel_validator = EnumAttributeValidator.new('String', ["email", "push"])
150
+ return false unless channel_validator.valid?(@channel)
151
+ return false if @project_id.nil?
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] template_body Value to be assigned
157
+ def template_body=(template_body)
158
+ if template_body.nil?
159
+ fail ArgumentError, 'template_body cannot be nil'
160
+ end
161
+
162
+ if template_body.to_s.length > 50000
163
+ fail ArgumentError, 'invalid value for "template_body", the character length must be smaller than or equal to 50000.'
164
+ end
165
+
166
+ @template_body = template_body
167
+ end
168
+
169
+ # Custom attribute writer method checking allowed values (enum).
170
+ # @param [Object] channel Object to be assigned
171
+ def channel=(channel)
172
+ validator = EnumAttributeValidator.new('String', ["email", "push"])
173
+ unless validator.valid?(channel)
174
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
175
+ end
176
+ @channel = channel
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] project_id Value to be assigned
181
+ def project_id=(project_id)
182
+ if project_id.nil?
183
+ fail ArgumentError, 'project_id cannot be nil'
184
+ end
185
+
186
+ @project_id = project_id
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ template_id == o.template_id &&
195
+ template_body == o.template_body &&
196
+ channel == o.channel &&
197
+ project_id == o.project_id
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [template_id, template_body, channel, project_id].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ transformed_hash = {}
219
+ openapi_types.each_pair do |key, type|
220
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = nil
222
+ elsif type =~ /\AArray<(.*)>/i
223
+ # check to ensure the input is an array given that the attribute
224
+ # is documented as an array but the input is not
225
+ if attributes[attribute_map[key]].is_a?(Array)
226
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
227
+ end
228
+ elsif !attributes[attribute_map[key]].nil?
229
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
230
+ end
231
+ end
232
+ new(transformed_hash)
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def self._deserialize(type, value)
240
+ case type.to_sym
241
+ when :Time
242
+ Time.parse(value)
243
+ when :Date
244
+ Date.parse(value)
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :Boolean
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else # model
272
+ # models (e.g. Pet) or oneOf
273
+ klass = Zyphr.const_get(type)
274
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+
324
+ end
325
+
326
+ end
data/lib/zyphr.rb CHANGED
@@ -20,6 +20,7 @@ require 'zyphr/configuration'
20
20
  require 'zyphr/models/add_domain200_response'
21
21
  require 'zyphr/models/add_domain200_response_meta'
22
22
  require 'zyphr/models/add_domain_request'
23
+ require 'zyphr/models/add_organization_member_request'
23
24
  require 'zyphr/models/add_topic_subscribers_request'
24
25
  require 'zyphr/models/api_error'
25
26
  require 'zyphr/models/api_error_error'
@@ -75,6 +76,7 @@ require 'zyphr/models/convert_anonymous_user_request_one_of1'
75
76
  require 'zyphr/models/convert_anonymous_user_request_one_of1_apple_user'
76
77
  require 'zyphr/models/convert_anonymous_user_request_one_of1_apple_user_name'
77
78
  require 'zyphr/models/create_category_request'
79
+ require 'zyphr/models/create_organization_request'
78
80
  require 'zyphr/models/create_subscriber_request'
79
81
  require 'zyphr/models/create_template_request'
80
82
  require 'zyphr/models/create_topic_request'
@@ -131,6 +133,14 @@ require 'zyphr/models/get_domain200_response_meta'
131
133
  require 'zyphr/models/get_waa_s_endpoint200_response'
132
134
  require 'zyphr/models/get_waa_s_usage200_response'
133
135
  require 'zyphr/models/in_app_notification'
136
+ require 'zyphr/models/inbound_attachment_url_response'
137
+ require 'zyphr/models/inbound_attachment_url_response_data'
138
+ require 'zyphr/models/inbound_email'
139
+ require 'zyphr/models/inbound_email_attachment'
140
+ require 'zyphr/models/inbound_email_from'
141
+ require 'zyphr/models/inbound_email_list_response'
142
+ require 'zyphr/models/inbound_email_list_response_meta'
143
+ require 'zyphr/models/inbound_email_response'
134
144
  require 'zyphr/models/inbox_list_meta'
135
145
  require 'zyphr/models/inbox_list_response'
136
146
  require 'zyphr/models/inbox_notification_response'
@@ -184,6 +194,14 @@ require 'zyphr/models/o_auth_tokens_refresh_response'
184
194
  require 'zyphr/models/o_auth_tokens_refresh_response_data'
185
195
  require 'zyphr/models/o_auth_tokens_response'
186
196
  require 'zyphr/models/o_auth_tokens_response_data'
197
+ require 'zyphr/models/organization'
198
+ require 'zyphr/models/organization_list_response'
199
+ require 'zyphr/models/organization_list_response_meta'
200
+ require 'zyphr/models/organization_members_list_response'
201
+ require 'zyphr/models/organization_membership'
202
+ require 'zyphr/models/organization_membership_response'
203
+ require 'zyphr/models/organization_membership_with_user'
204
+ require 'zyphr/models/organization_response'
187
205
  require 'zyphr/models/pagination_meta'
188
206
  require 'zyphr/models/password_requirements'
189
207
  require 'zyphr/models/password_requirements_response'
@@ -270,6 +288,7 @@ require 'zyphr/models/send_webhook_test_event_request'
270
288
  require 'zyphr/models/session_list_response'
271
289
  require 'zyphr/models/session_list_response_data'
272
290
  require 'zyphr/models/session_list_response_data_session_info'
291
+ require 'zyphr/models/set_domain_inbound_request'
273
292
  require 'zyphr/models/set_preferences_request'
274
293
  require 'zyphr/models/set_preferences_request_preferences_inner'
275
294
  require 'zyphr/models/sign_in_anonymously_request'
@@ -296,6 +315,11 @@ require 'zyphr/models/subscriber_list_response'
296
315
  require 'zyphr/models/subscriber_preference'
297
316
  require 'zyphr/models/subscriber_response'
298
317
  require 'zyphr/models/success_result'
318
+ require 'zyphr/models/switch_organization_request'
319
+ require 'zyphr/models/switch_organization_response'
320
+ require 'zyphr/models/switch_organization_response_data'
321
+ require 'zyphr/models/switch_organization_response_data_tokens'
322
+ require 'zyphr/models/switch_organization_response_data_user'
299
323
  require 'zyphr/models/template'
300
324
  require 'zyphr/models/template_list_response'
301
325
  require 'zyphr/models/template_render_response'
@@ -324,6 +348,8 @@ require 'zyphr/models/unsubscribe_request'
324
348
  require 'zyphr/models/unsubscribe_response'
325
349
  require 'zyphr/models/update_category_request'
326
350
  require 'zyphr/models/update_end_user_request'
351
+ require 'zyphr/models/update_organization_member_role_request'
352
+ require 'zyphr/models/update_organization_request'
327
353
  require 'zyphr/models/update_subscriber_preferences_request'
328
354
  require 'zyphr/models/update_subscriber_preferences_request_preferences_inner'
329
355
  require 'zyphr/models/update_subscriber_request'
@@ -337,6 +363,7 @@ require 'zyphr/models/upsert_auth_email_template_request'
337
363
  require 'zyphr/models/upsert_sms_config_request'
338
364
  require 'zyphr/models/user_devices_delete_response'
339
365
  require 'zyphr/models/user_devices_delete_response_data'
366
+ require 'zyphr/models/v1_muse_subjects_suggest_post_request'
340
367
  require 'zyphr/models/validate_reset_token_request'
341
368
  require 'zyphr/models/validate_reset_token_response'
342
369
  require 'zyphr/models/validate_reset_token_response_data'
@@ -422,6 +449,7 @@ require 'zyphr/api/auth_login_api'
422
449
  require 'zyphr/api/auth_mfa_api'
423
450
  require 'zyphr/api/auth_magic_links_api'
424
451
  require 'zyphr/api/auth_o_auth_api'
452
+ require 'zyphr/api/auth_organizations_api'
425
453
  require 'zyphr/api/auth_password_reset_api'
426
454
  require 'zyphr/api/auth_phone_api'
427
455
  require 'zyphr/api/auth_registration_api'
@@ -432,7 +460,9 @@ require 'zyphr/api/devices_api'
432
460
  require 'zyphr/api/domains_api'
433
461
  require 'zyphr/api/emails_api'
434
462
  require 'zyphr/api/executions_api'
463
+ require 'zyphr/api/inbound_email_api'
435
464
  require 'zyphr/api/inbox_api'
465
+ require 'zyphr/api/muse_api'
436
466
  require 'zyphr/api/push_api'
437
467
  require 'zyphr/api/sms_api'
438
468
  require 'zyphr/api/slack_api'
@@ -0,0 +1,171 @@
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 ## 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::AuthOrganizationsApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AuthOrganizationsApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = Zyphr::AuthOrganizationsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AuthOrganizationsApi' do
30
+ it 'should create an instance of AuthOrganizationsApi' do
31
+ expect(@api_instance).to be_instance_of(Zyphr::AuthOrganizationsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for add_organization_member
36
+ # Add a member to an organization
37
+ # @param id
38
+ # @param add_organization_member_request
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [OrganizationMembershipResponse]
41
+ describe 'add_organization_member 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 create_organization
48
+ # Create an organization
49
+ # Create a new organization inside the current application × environment. Membership is many-to-many — add end users via POST /auth/organizations/{id}/members. The Default organization for the environment is auto-created at migration time and cannot be created via API.
50
+ # @param create_organization_request
51
+ # @param [Hash] opts the optional parameters
52
+ # @return [OrganizationResponse]
53
+ describe 'create_organization 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
+
59
+ # unit tests for delete_organization
60
+ # Delete an organization
61
+ # Hard-deletes the org and cascades memberships. The Default organization cannot be deleted.
62
+ # @param id
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [nil]
65
+ describe 'delete_organization test' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
68
+ end
69
+ end
70
+
71
+ # unit tests for get_organization
72
+ # Get organization by id
73
+ # @param id
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [OrganizationResponse]
76
+ describe 'get_organization test' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
79
+ end
80
+ end
81
+
82
+ # unit tests for list_organization_members
83
+ # List organization members
84
+ # @param id
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [Integer] :limit
87
+ # @option opts [String] :cursor
88
+ # @return [OrganizationMembersListResponse]
89
+ describe 'list_organization_members 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
+
95
+ # unit tests for list_organizations
96
+ # List organizations
97
+ # List organizations in the current environment. Cursor-paginated.
98
+ # @param [Hash] opts the optional parameters
99
+ # @option opts [Integer] :limit
100
+ # @option opts [String] :cursor
101
+ # @option opts [String] :search ILIKE match on name OR slug
102
+ # @return [OrganizationListResponse]
103
+ describe 'list_organizations test' do
104
+ it 'should work' do
105
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
106
+ end
107
+ end
108
+
109
+ # unit tests for list_organizations_for_end_user
110
+ # List organizations an end user belongs to
111
+ # Inverse of the membership list — returns all orgs the user is a member of within the current environment. Use this when the orgs[] JWT claim is omitted because the user belongs to more than 50.
112
+ # @param user_id
113
+ # @param [Hash] opts the optional parameters
114
+ # @return [OrganizationListResponse]
115
+ describe 'list_organizations_for_end_user 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 remove_organization_member
122
+ # Remove a member from an organization
123
+ # @param id
124
+ # @param user_id
125
+ # @param [Hash] opts the optional parameters
126
+ # @return [nil]
127
+ describe 'remove_organization_member test' do
128
+ it 'should work' do
129
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
130
+ end
131
+ end
132
+
133
+ # unit tests for switch_organization
134
+ # Switch the active organization on a session
135
+ # Takes a valid refresh token + a target organization the user is a member of, verifies membership at mint time, revokes the old session, and mints a fresh access + refresh pair with &#x60;org_id&#x60; set to the target. The old refresh token is invalidated (jti rotated). Use this when the user&#39;s active workspace changes (the Slack/Linear workspace-switch pattern).
136
+ # @param switch_organization_request
137
+ # @param [Hash] opts the optional parameters
138
+ # @return [SwitchOrganizationResponse]
139
+ describe 'switch_organization test' do
140
+ it 'should work' do
141
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
142
+ end
143
+ end
144
+
145
+ # unit tests for update_organization
146
+ # Update an organization
147
+ # The Default organization cannot be renamed or have its slug/metadata changed.
148
+ # @param id
149
+ # @param update_organization_request
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [OrganizationResponse]
152
+ describe 'update_organization test' do
153
+ it 'should work' do
154
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
155
+ end
156
+ end
157
+
158
+ # unit tests for update_organization_member_role
159
+ # Update a member&#39;s role
160
+ # @param id
161
+ # @param user_id
162
+ # @param update_organization_member_role_request
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [OrganizationMembershipResponse]
165
+ describe 'update_organization_member_role test' do
166
+ it 'should work' do
167
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
168
+ end
169
+ end
170
+
171
+ end
@@ -43,6 +43,18 @@ describe 'AuthUserProfileApi' do
43
43
  end
44
44
  end
45
45
 
46
+ # unit tests for delete_end_user_by_application
47
+ # Delete an end user (test environment only)
48
+ # App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service &#x60;DELETE /auth/users/me&#x60; flow: revokes all sessions, soft-deletes the row (status&#x3D;&#39;deleted&#39;), and emits a &#x60;user.deleted&#x60; webhook with &#x60;method&#x3D;&#39;application_admin&#39;&#x60;. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use &#x60;DELETE /auth/users/me&#x60; from the end-user&#39;s own session or the dashboard.
49
+ # @param user_id
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [nil]
52
+ describe 'delete_end_user_by_application test' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
55
+ end
56
+ end
57
+
46
58
  # unit tests for get_end_user
47
59
  # Get current end user profile
48
60
  # Retrieve the profile of the currently authenticated end user.
@@ -91,6 +91,19 @@ describe 'DomainsApi' do
91
91
  end
92
92
  end
93
93
 
94
+ # unit tests for set_domain_inbound
95
+ # Enable or disable inbound email for a domain
96
+ # Toggle email receiving for a domain. When enabled, the domain&#39;s DNS records gain an MX record on the &#x60;inbound.&#x60; subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
97
+ # @param id
98
+ # @param set_domain_inbound_request
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [nil]
101
+ describe 'set_domain_inbound test' do
102
+ it 'should work' do
103
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
104
+ end
105
+ end
106
+
94
107
  # unit tests for verify_domain
95
108
  # Trigger domain verification
96
109
  # Queue an asynchronous DNS verification check. Returns immediately with a &#x60;job_id&#x60;. Poll &#x60;GET /v1/domains/{id}/verification-status&#x60; (or the higher-level &#x60;GET /v1/domains/{id}&#x60;) for the result, or subscribe to the &#x60;domain.verified&#x60; webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).