zyphr 0.1.60 → 0.1.61
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 +1 -0
- data/docs/WaaSBatchPublishResponse.md +5 -3
- data/docs/WaaSBatchPublishResult.md +34 -0
- data/docs/WaaSPublishEventResponse.md +7 -3
- data/lib/zyphr/models/waa_s_batch_publish_response.rb +19 -8
- data/lib/zyphr/models/waa_s_batch_publish_result.rb +299 -0
- data/lib/zyphr/models/waa_s_publish_event_response.rb +24 -4
- data/lib/zyphr.rb +1 -0
- data/spec/models/waa_s_batch_publish_response_spec.rb +7 -1
- data/spec/models/waa_s_batch_publish_result_spec.rb +84 -0
- data/spec/models/waa_s_publish_event_response_spec.rb +12 -0
- data/zyphr.gemspec +1 -1
- metadata +493 -489
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0edad2513c64736813f1d6abc94ba324b16d8d4e7673d5fef9b2c05b725b9b8
|
|
4
|
+
data.tar.gz: 58d67a8389b3fb911dca325b88f21579c68da778f58ee28b224dc782d2e74d13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dea965cbdb3461df7a8b1f1c7b6504862db80a9a48d9c6b76a48667fb6bdfd437c26fb84f6347919eedadbc4d7db9d90e18ed35caedebc4cc89ed7db5be0e66
|
|
7
|
+
data.tar.gz: 6f39bae99b0abd925311a58f7a7a19e0fb297f9aab266d5ab96459fb40e1d605847d34ff37197b980c49e8b62247469bbcc59fbac60ecf6380ec9cd87d25c5d5
|
data/README.md
CHANGED
|
@@ -819,6 +819,7 @@ Class | Method | HTTP request | Description
|
|
|
819
819
|
- [Zyphr::WaaSApplication](docs/WaaSApplication.md)
|
|
820
820
|
- [Zyphr::WaaSBatchPublishRequest](docs/WaaSBatchPublishRequest.md)
|
|
821
821
|
- [Zyphr::WaaSBatchPublishResponse](docs/WaaSBatchPublishResponse.md)
|
|
822
|
+
- [Zyphr::WaaSBatchPublishResult](docs/WaaSBatchPublishResult.md)
|
|
822
823
|
- [Zyphr::WaaSDelivery](docs/WaaSDelivery.md)
|
|
823
824
|
- [Zyphr::WaaSEndpoint](docs/WaaSEndpoint.md)
|
|
824
825
|
- [Zyphr::WaaSEventType](docs/WaaSEventType.md)
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **
|
|
7
|
+
| **total** | **Integer** | Events in the request | [optional] |
|
|
8
|
+
| **succeeded** | **Integer** | | [optional] |
|
|
8
9
|
| **failed** | **Integer** | | [optional] |
|
|
9
|
-
| **results** | **Array<
|
|
10
|
+
| **results** | [**Array<WaaSBatchPublishResult>**](WaaSBatchPublishResult.md) | One entry per event, in request order. A published event has the same fields as a single publish (`event_id`, `endpoints_matched`, `deliveries_created`, `created_at`, ...). An event that was not published has `error` and `code` instead, e.g. `code: usage_limit_exceeded` when the monthly event limit is reached. Tell them apart by the presence of `error`. | [optional] |
|
|
10
11
|
|
|
11
12
|
## Example
|
|
12
13
|
|
|
@@ -14,7 +15,8 @@
|
|
|
14
15
|
require 'zyphr'
|
|
15
16
|
|
|
16
17
|
instance = Zyphr::WaaSBatchPublishResponse.new(
|
|
17
|
-
|
|
18
|
+
total: null,
|
|
19
|
+
succeeded: null,
|
|
18
20
|
failed: null,
|
|
19
21
|
results: null
|
|
20
22
|
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Zyphr::WaaSBatchPublishResult
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **event_id** | **String** | Set when the event was published | [optional] |
|
|
8
|
+
| **event_type** | **String** | | [optional] |
|
|
9
|
+
| **tenant_id** | **String** | | [optional] |
|
|
10
|
+
| **endpoints_matched** | **Integer** | Set when the event was published | [optional] |
|
|
11
|
+
| **deliveries_created** | **Integer** | Set when the event was published | [optional] |
|
|
12
|
+
| **created_at** | **Time** | Set when the event was published | [optional] |
|
|
13
|
+
| **deduplicated** | **Boolean** | True when the idempotency key matched an earlier publish | [optional] |
|
|
14
|
+
| **error** | **String** | Set when the event was not published | [optional] |
|
|
15
|
+
| **code** | **String** | Set when the event was not published, e.g. `usage_limit_exceeded` (monthly event limit reached), `event_type_not_found`, `event_type_deprecated`, `internal_error` | [optional] |
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
require 'zyphr'
|
|
21
|
+
|
|
22
|
+
instance = Zyphr::WaaSBatchPublishResult.new(
|
|
23
|
+
event_id: null,
|
|
24
|
+
event_type: null,
|
|
25
|
+
tenant_id: null,
|
|
26
|
+
endpoints_matched: null,
|
|
27
|
+
deliveries_created: null,
|
|
28
|
+
created_at: null,
|
|
29
|
+
deduplicated: null,
|
|
30
|
+
error: WaaS event limit reached (250000/250000),
|
|
31
|
+
code: usage_limit_exceeded
|
|
32
|
+
)
|
|
33
|
+
```
|
|
34
|
+
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **event_id** | **String** |
|
|
7
|
+
| **event_id** | **String** | Prefixed id, not a bare UUID | [optional] |
|
|
8
8
|
| **event_type** | **String** | | [optional] |
|
|
9
9
|
| **tenant_id** | **String** | | [optional] |
|
|
10
10
|
| **endpoints_matched** | **Integer** | | [optional] |
|
|
11
11
|
| **deliveries_created** | **Integer** | | [optional] |
|
|
12
|
+
| **created_at** | **Time** | | [optional] |
|
|
13
|
+
| **deduplicated** | **Boolean** | Present and true when the idempotency key matched an earlier publish, which is returned instead of publishing again | [optional] |
|
|
12
14
|
|
|
13
15
|
## Example
|
|
14
16
|
|
|
@@ -16,11 +18,13 @@
|
|
|
16
18
|
require 'zyphr'
|
|
17
19
|
|
|
18
20
|
instance = Zyphr::WaaSPublishEventResponse.new(
|
|
19
|
-
event_id:
|
|
21
|
+
event_id: evt_3f6c1e2a-8b4d-4c1e-9a7f-2d5b6e8c9a10,
|
|
20
22
|
event_type: null,
|
|
21
23
|
tenant_id: null,
|
|
22
24
|
endpoints_matched: null,
|
|
23
|
-
deliveries_created: null
|
|
25
|
+
deliveries_created: null,
|
|
26
|
+
created_at: null,
|
|
27
|
+
deduplicated: null
|
|
24
28
|
)
|
|
25
29
|
```
|
|
26
30
|
|
|
@@ -15,16 +15,21 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zyphr
|
|
17
17
|
class WaaSBatchPublishResponse
|
|
18
|
-
|
|
18
|
+
# Events in the request
|
|
19
|
+
attr_accessor :total
|
|
20
|
+
|
|
21
|
+
attr_accessor :succeeded
|
|
19
22
|
|
|
20
23
|
attr_accessor :failed
|
|
21
24
|
|
|
25
|
+
# One entry per event, in request order. A published event has the same fields as a single publish (`event_id`, `endpoints_matched`, `deliveries_created`, `created_at`, ...). An event that was not published has `error` and `code` instead, e.g. `code: usage_limit_exceeded` when the monthly event limit is reached. Tell them apart by the presence of `error`.
|
|
22
26
|
attr_accessor :results
|
|
23
27
|
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
29
|
def self.attribute_map
|
|
26
30
|
{
|
|
27
|
-
:'
|
|
31
|
+
:'total' => :'total',
|
|
32
|
+
:'succeeded' => :'succeeded',
|
|
28
33
|
:'failed' => :'failed',
|
|
29
34
|
:'results' => :'results'
|
|
30
35
|
}
|
|
@@ -43,9 +48,10 @@ module Zyphr
|
|
|
43
48
|
# Attribute type mapping.
|
|
44
49
|
def self.openapi_types
|
|
45
50
|
{
|
|
46
|
-
:'
|
|
51
|
+
:'total' => :'Integer',
|
|
52
|
+
:'succeeded' => :'Integer',
|
|
47
53
|
:'failed' => :'Integer',
|
|
48
|
-
:'results' => :'Array<
|
|
54
|
+
:'results' => :'Array<WaaSBatchPublishResult>'
|
|
49
55
|
}
|
|
50
56
|
end
|
|
51
57
|
|
|
@@ -71,8 +77,12 @@ module Zyphr
|
|
|
71
77
|
h[k.to_sym] = v
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
if attributes.key?(:'
|
|
75
|
-
self.
|
|
80
|
+
if attributes.key?(:'total')
|
|
81
|
+
self.total = attributes[:'total']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'succeeded')
|
|
85
|
+
self.succeeded = attributes[:'succeeded']
|
|
76
86
|
end
|
|
77
87
|
|
|
78
88
|
if attributes.key?(:'failed')
|
|
@@ -106,7 +116,8 @@ module Zyphr
|
|
|
106
116
|
def ==(o)
|
|
107
117
|
return true if self.equal?(o)
|
|
108
118
|
self.class == o.class &&
|
|
109
|
-
|
|
119
|
+
total == o.total &&
|
|
120
|
+
succeeded == o.succeeded &&
|
|
110
121
|
failed == o.failed &&
|
|
111
122
|
results == o.results
|
|
112
123
|
end
|
|
@@ -120,7 +131,7 @@ module Zyphr
|
|
|
120
131
|
# Calculates hash code according to all attributes.
|
|
121
132
|
# @return [Integer] Hash code
|
|
122
133
|
def hash
|
|
123
|
-
[
|
|
134
|
+
[total, succeeded, failed, results].hash
|
|
124
135
|
end
|
|
125
136
|
|
|
126
137
|
# Builds the object from hash
|
|
@@ -0,0 +1,299 @@
|
|
|
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. > **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 WaaSBatchPublishResult
|
|
18
|
+
# Set when the event was published
|
|
19
|
+
attr_accessor :event_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :event_type
|
|
22
|
+
|
|
23
|
+
attr_accessor :tenant_id
|
|
24
|
+
|
|
25
|
+
# Set when the event was published
|
|
26
|
+
attr_accessor :endpoints_matched
|
|
27
|
+
|
|
28
|
+
# Set when the event was published
|
|
29
|
+
attr_accessor :deliveries_created
|
|
30
|
+
|
|
31
|
+
# Set when the event was published
|
|
32
|
+
attr_accessor :created_at
|
|
33
|
+
|
|
34
|
+
# True when the idempotency key matched an earlier publish
|
|
35
|
+
attr_accessor :deduplicated
|
|
36
|
+
|
|
37
|
+
# Set when the event was not published
|
|
38
|
+
attr_accessor :error
|
|
39
|
+
|
|
40
|
+
# Set when the event was not published, e.g. `usage_limit_exceeded` (monthly event limit reached), `event_type_not_found`, `event_type_deprecated`, `internal_error`
|
|
41
|
+
attr_accessor :code
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'event_id' => :'event_id',
|
|
47
|
+
:'event_type' => :'event_type',
|
|
48
|
+
:'tenant_id' => :'tenant_id',
|
|
49
|
+
:'endpoints_matched' => :'endpoints_matched',
|
|
50
|
+
:'deliveries_created' => :'deliveries_created',
|
|
51
|
+
:'created_at' => :'created_at',
|
|
52
|
+
:'deduplicated' => :'deduplicated',
|
|
53
|
+
:'error' => :'error',
|
|
54
|
+
:'code' => :'code'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'event_id' => :'String',
|
|
72
|
+
:'event_type' => :'String',
|
|
73
|
+
:'tenant_id' => :'String',
|
|
74
|
+
:'endpoints_matched' => :'Integer',
|
|
75
|
+
:'deliveries_created' => :'Integer',
|
|
76
|
+
:'created_at' => :'Time',
|
|
77
|
+
:'deduplicated' => :'Boolean',
|
|
78
|
+
:'error' => :'String',
|
|
79
|
+
:'code' => :'String'
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of attributes with nullable: true
|
|
84
|
+
def self.openapi_nullable
|
|
85
|
+
Set.new([
|
|
86
|
+
])
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Initializes the object
|
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
91
|
+
def initialize(attributes = {})
|
|
92
|
+
if (!attributes.is_a?(Hash))
|
|
93
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::WaaSBatchPublishResult` initialize method"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
97
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
99
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::WaaSBatchPublishResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
101
|
+
end
|
|
102
|
+
h[k.to_sym] = v
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'event_id')
|
|
106
|
+
self.event_id = attributes[:'event_id']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'event_type')
|
|
110
|
+
self.event_type = attributes[:'event_type']
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'tenant_id')
|
|
114
|
+
self.tenant_id = attributes[:'tenant_id']
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'endpoints_matched')
|
|
118
|
+
self.endpoints_matched = attributes[:'endpoints_matched']
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'deliveries_created')
|
|
122
|
+
self.deliveries_created = attributes[:'deliveries_created']
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'created_at')
|
|
126
|
+
self.created_at = attributes[:'created_at']
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'deduplicated')
|
|
130
|
+
self.deduplicated = attributes[:'deduplicated']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'error')
|
|
134
|
+
self.error = attributes[:'error']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'code')
|
|
138
|
+
self.code = attributes[:'code']
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
143
|
+
# @return Array for valid properties with the reasons
|
|
144
|
+
def list_invalid_properties
|
|
145
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
146
|
+
invalid_properties = Array.new
|
|
147
|
+
invalid_properties
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Check to see if the all the properties in the model are valid
|
|
151
|
+
# @return true if the model is valid
|
|
152
|
+
def valid?
|
|
153
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
154
|
+
true
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Checks equality by comparing each attribute.
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def ==(o)
|
|
160
|
+
return true if self.equal?(o)
|
|
161
|
+
self.class == o.class &&
|
|
162
|
+
event_id == o.event_id &&
|
|
163
|
+
event_type == o.event_type &&
|
|
164
|
+
tenant_id == o.tenant_id &&
|
|
165
|
+
endpoints_matched == o.endpoints_matched &&
|
|
166
|
+
deliveries_created == o.deliveries_created &&
|
|
167
|
+
created_at == o.created_at &&
|
|
168
|
+
deduplicated == o.deduplicated &&
|
|
169
|
+
error == o.error &&
|
|
170
|
+
code == o.code
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# @see the `==` method
|
|
174
|
+
# @param [Object] Object to be compared
|
|
175
|
+
def eql?(o)
|
|
176
|
+
self == o
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Calculates hash code according to all attributes.
|
|
180
|
+
# @return [Integer] Hash code
|
|
181
|
+
def hash
|
|
182
|
+
[event_id, event_type, tenant_id, endpoints_matched, deliveries_created, created_at, deduplicated, error, code].hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Builds the object from hash
|
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
187
|
+
# @return [Object] Returns the model itself
|
|
188
|
+
def self.build_from_hash(attributes)
|
|
189
|
+
return nil unless attributes.is_a?(Hash)
|
|
190
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
191
|
+
transformed_hash = {}
|
|
192
|
+
openapi_types.each_pair do |key, type|
|
|
193
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = nil
|
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
196
|
+
# check to ensure the input is an array given that the attribute
|
|
197
|
+
# is documented as an array but the input is not
|
|
198
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
199
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
200
|
+
end
|
|
201
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
202
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
new(transformed_hash)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Deserializes the data based on type
|
|
209
|
+
# @param string type Data type
|
|
210
|
+
# @param string value Value to be deserialized
|
|
211
|
+
# @return [Object] Deserialized data
|
|
212
|
+
def self._deserialize(type, value)
|
|
213
|
+
case type.to_sym
|
|
214
|
+
when :Time
|
|
215
|
+
Time.parse(value)
|
|
216
|
+
when :Date
|
|
217
|
+
Date.parse(value)
|
|
218
|
+
when :String
|
|
219
|
+
value.to_s
|
|
220
|
+
when :Integer
|
|
221
|
+
value.to_i
|
|
222
|
+
when :Float
|
|
223
|
+
value.to_f
|
|
224
|
+
when :Boolean
|
|
225
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
226
|
+
true
|
|
227
|
+
else
|
|
228
|
+
false
|
|
229
|
+
end
|
|
230
|
+
when :Object
|
|
231
|
+
# generic object (usually a Hash), return directly
|
|
232
|
+
value
|
|
233
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
234
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
235
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
236
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
237
|
+
k_type = Regexp.last_match[:k_type]
|
|
238
|
+
v_type = Regexp.last_match[:v_type]
|
|
239
|
+
{}.tap do |hash|
|
|
240
|
+
value.each do |k, v|
|
|
241
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
else # model
|
|
245
|
+
# models (e.g. Pet) or oneOf
|
|
246
|
+
klass = Zyphr.const_get(type)
|
|
247
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Returns the string representation of the object
|
|
252
|
+
# @return [String] String presentation of the object
|
|
253
|
+
def to_s
|
|
254
|
+
to_hash.to_s
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
|
259
|
+
def to_body
|
|
260
|
+
to_hash
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Returns the object in the form of hash
|
|
264
|
+
# @return [Hash] Returns the object in the form of hash
|
|
265
|
+
def to_hash
|
|
266
|
+
hash = {}
|
|
267
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
268
|
+
value = self.send(attr)
|
|
269
|
+
if value.nil?
|
|
270
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
271
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
hash[param] = _to_hash(value)
|
|
275
|
+
end
|
|
276
|
+
hash
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Outputs non-array value in the form of hash
|
|
280
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
281
|
+
# @param [Object] value Any valid value
|
|
282
|
+
# @return [Hash] Returns the value in the form of hash
|
|
283
|
+
def _to_hash(value)
|
|
284
|
+
if value.is_a?(Array)
|
|
285
|
+
value.compact.map { |v| _to_hash(v) }
|
|
286
|
+
elsif value.is_a?(Hash)
|
|
287
|
+
{}.tap do |hash|
|
|
288
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
289
|
+
end
|
|
290
|
+
elsif value.respond_to? :to_hash
|
|
291
|
+
value.to_hash
|
|
292
|
+
else
|
|
293
|
+
value
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
end
|
|
@@ -15,6 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zyphr
|
|
17
17
|
class WaaSPublishEventResponse
|
|
18
|
+
# Prefixed id, not a bare UUID
|
|
18
19
|
attr_accessor :event_id
|
|
19
20
|
|
|
20
21
|
attr_accessor :event_type
|
|
@@ -25,6 +26,11 @@ module Zyphr
|
|
|
25
26
|
|
|
26
27
|
attr_accessor :deliveries_created
|
|
27
28
|
|
|
29
|
+
attr_accessor :created_at
|
|
30
|
+
|
|
31
|
+
# Present and true when the idempotency key matched an earlier publish, which is returned instead of publishing again
|
|
32
|
+
attr_accessor :deduplicated
|
|
33
|
+
|
|
28
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
35
|
def self.attribute_map
|
|
30
36
|
{
|
|
@@ -32,7 +38,9 @@ module Zyphr
|
|
|
32
38
|
:'event_type' => :'event_type',
|
|
33
39
|
:'tenant_id' => :'tenant_id',
|
|
34
40
|
:'endpoints_matched' => :'endpoints_matched',
|
|
35
|
-
:'deliveries_created' => :'deliveries_created'
|
|
41
|
+
:'deliveries_created' => :'deliveries_created',
|
|
42
|
+
:'created_at' => :'created_at',
|
|
43
|
+
:'deduplicated' => :'deduplicated'
|
|
36
44
|
}
|
|
37
45
|
end
|
|
38
46
|
|
|
@@ -53,7 +61,9 @@ module Zyphr
|
|
|
53
61
|
:'event_type' => :'String',
|
|
54
62
|
:'tenant_id' => :'String',
|
|
55
63
|
:'endpoints_matched' => :'Integer',
|
|
56
|
-
:'deliveries_created' => :'Integer'
|
|
64
|
+
:'deliveries_created' => :'Integer',
|
|
65
|
+
:'created_at' => :'Time',
|
|
66
|
+
:'deduplicated' => :'Boolean'
|
|
57
67
|
}
|
|
58
68
|
end
|
|
59
69
|
|
|
@@ -98,6 +108,14 @@ module Zyphr
|
|
|
98
108
|
if attributes.key?(:'deliveries_created')
|
|
99
109
|
self.deliveries_created = attributes[:'deliveries_created']
|
|
100
110
|
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'created_at')
|
|
113
|
+
self.created_at = attributes[:'created_at']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'deduplicated')
|
|
117
|
+
self.deduplicated = attributes[:'deduplicated']
|
|
118
|
+
end
|
|
101
119
|
end
|
|
102
120
|
|
|
103
121
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -124,7 +142,9 @@ module Zyphr
|
|
|
124
142
|
event_type == o.event_type &&
|
|
125
143
|
tenant_id == o.tenant_id &&
|
|
126
144
|
endpoints_matched == o.endpoints_matched &&
|
|
127
|
-
deliveries_created == o.deliveries_created
|
|
145
|
+
deliveries_created == o.deliveries_created &&
|
|
146
|
+
created_at == o.created_at &&
|
|
147
|
+
deduplicated == o.deduplicated
|
|
128
148
|
end
|
|
129
149
|
|
|
130
150
|
# @see the `==` method
|
|
@@ -136,7 +156,7 @@ module Zyphr
|
|
|
136
156
|
# Calculates hash code according to all attributes.
|
|
137
157
|
# @return [Integer] Hash code
|
|
138
158
|
def hash
|
|
139
|
-
[event_id, event_type, tenant_id, endpoints_matched, deliveries_created].hash
|
|
159
|
+
[event_id, event_type, tenant_id, endpoints_matched, deliveries_created, created_at, deduplicated].hash
|
|
140
160
|
end
|
|
141
161
|
|
|
142
162
|
# Builds the object from hash
|
data/lib/zyphr.rb
CHANGED
|
@@ -452,6 +452,7 @@ require 'zyphr/models/verify_sms_config_response'
|
|
|
452
452
|
require 'zyphr/models/waa_s_application'
|
|
453
453
|
require 'zyphr/models/waa_s_batch_publish_request'
|
|
454
454
|
require 'zyphr/models/waa_s_batch_publish_response'
|
|
455
|
+
require 'zyphr/models/waa_s_batch_publish_result'
|
|
455
456
|
require 'zyphr/models/waa_s_delivery'
|
|
456
457
|
require 'zyphr/models/waa_s_endpoint'
|
|
457
458
|
require 'zyphr/models/waa_s_event_type'
|
|
@@ -27,7 +27,13 @@ describe Zyphr::WaaSBatchPublishResponse do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
describe 'test attribute "
|
|
30
|
+
describe 'test attribute "total"' 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 "succeeded"' do
|
|
31
37
|
it 'should work' do
|
|
32
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
39
|
end
|
|
@@ -0,0 +1,84 @@
|
|
|
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. > **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::WaaSBatchPublishResult
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zyphr::WaaSBatchPublishResult do
|
|
21
|
+
let(:instance) { Zyphr::WaaSBatchPublishResult.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of WaaSBatchPublishResult' do
|
|
24
|
+
it 'should create an instance of WaaSBatchPublishResult' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zyphr::WaaSBatchPublishResult)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "event_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 "event_type"' 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 "tenant_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 "endpoints_matched"' 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 "deliveries_created"' 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 "deduplicated"' 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
|
+
describe 'test attribute "error"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
describe 'test attribute "code"' do
|
|
79
|
+
it 'should work' do
|
|
80
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|