sendmux-management 1.0.0
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 +7 -0
- data/CHANGELOG.md +12 -0
- data/README.md +3 -0
- data/lib/sendmux/management/client.rb +66 -0
- data/lib/sendmux/management/version.rb +7 -0
- data/lib/sendmux/management.rb +12 -0
- data/lib/sendmux_management_generated/api/billing_api.rb +221 -0
- data/lib/sendmux_management_generated/api/domain_filters_api.rb +161 -0
- data/lib/sendmux_management_generated/api/domains_api.rb +419 -0
- data/lib/sendmux_management_generated/api/emails_api.rb +258 -0
- data/lib/sendmux_management_generated/api/inboxes_api.rb +175 -0
- data/lib/sendmux_management_generated/api/mailbox_filters_api.rb +161 -0
- data/lib/sendmux_management_generated/api/mailboxes_api.rb +659 -0
- data/lib/sendmux_management_generated/api/sending_accounts_api.rb +946 -0
- data/lib/sendmux_management_generated/api/webhooks_api.rb +666 -0
- data/lib/sendmux_management_generated/api_client.rb +441 -0
- data/lib/sendmux_management_generated/api_error.rb +58 -0
- data/lib/sendmux_management_generated/api_model_base.rb +88 -0
- data/lib/sendmux_management_generated/configuration.rb +393 -0
- data/lib/sendmux_management_generated/models/api_error_detail.rb +219 -0
- data/lib/sendmux_management_generated/models/api_error_error.rb +275 -0
- data/lib/sendmux_management_generated/models/api_error_meta.rb +164 -0
- data/lib/sendmux_management_generated/models/api_error_response.rb +216 -0
- data/lib/sendmux_management_generated/models/balance.rb +293 -0
- data/lib/sendmux_management_generated/models/balance_auto_topup.rb +226 -0
- data/lib/sendmux_management_generated/models/balance_response.rb +223 -0
- data/lib/sendmux_management_generated/models/cursor_pagination.rb +173 -0
- data/lib/sendmux_management_generated/models/delivery_log_item.rb +393 -0
- data/lib/sendmux_management_generated/models/delivery_log_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/delivery_log_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_deleted_response_all_of_data.rb +190 -0
- data/lib/sendmux_management_generated/models/domain_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/domain_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/domain_verify_response.rb +223 -0
- data/lib/sendmux_management_generated/models/email_metrics.rb +218 -0
- data/lib/sendmux_management_generated/models/email_metrics_comparison.rb +294 -0
- data/lib/sendmux_management_generated/models/email_metrics_comparison_change_pct.rb +268 -0
- data/lib/sendmux_management_generated/models/email_metrics_response.rb +223 -0
- data/lib/sendmux_management_generated/models/email_metrics_summary.rb +268 -0
- data/lib/sendmux_management_generated/models/email_metrics_timeseries_inner.rb +294 -0
- data/lib/sendmux_management_generated/models/filter_rule.rb +242 -0
- data/lib/sendmux_management_generated/models/filter_state.rb +218 -0
- data/lib/sendmux_management_generated/models/filter_state_response.rb +223 -0
- data/lib/sendmux_management_generated/models/incoming_log_item.rb +465 -0
- data/lib/sendmux_management_generated/models/incoming_log_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/incoming_log_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox.rb +284 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result.rb +164 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result_credential.rb +359 -0
- data/lib/sendmux_management_generated/models/mailbox_app_password_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_create_result.rb +189 -0
- data/lib/sendmux_management_generated/models/mailbox_create_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_credential.rb +353 -0
- data/lib/sendmux_management_generated/models/mailbox_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_domain.rb +358 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_dns_records.rb +276 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_mx_record.rb +190 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_name_value_record.rb +191 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_checks.rb +246 -0
- data/lib/sendmux_management_generated/models/mailbox_domain_verify_result.rb +242 -0
- data/lib/sendmux_management_generated/models/mailbox_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/mailbox_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_key_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/mailbox_send_scope.rb +213 -0
- data/lib/sendmux_management_generated/models/management_create_domain_request.rb +165 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_key_request.rb +182 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_request.rb +257 -0
- data/lib/sendmux_management_generated/models/management_create_mailbox_request_send_scope.rb +210 -0
- data/lib/sendmux_management_generated/models/management_test_webhook200_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_allowed_actions.rb +268 -0
- data/lib/sendmux_management_generated/models/provider_create_body.rb +579 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas.rb +174 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day.rb +104 -0
- data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day_any_of.rb +215 -0
- data/lib/sendmux_management_generated/models/provider_deleted.rb +190 -0
- data/lib/sendmux_management_generated/models/provider_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_item.rb +695 -0
- data/lib/sendmux_management_generated/models/provider_item_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/provider_item_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_limits.rb +190 -0
- data/lib/sendmux_management_generated/models/provider_limits_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_quota_range.rb +208 -0
- data/lib/sendmux_management_generated/models/provider_quotas.rb +186 -0
- data/lib/sendmux_management_generated/models/provider_stats.rb +325 -0
- data/lib/sendmux_management_generated/models/provider_stats_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_status_counts.rb +242 -0
- data/lib/sendmux_management_generated/models/provider_test_result.rb +251 -0
- data/lib/sendmux_management_generated/models/provider_test_result_response.rb +223 -0
- data/lib/sendmux_management_generated/models/provider_type_counts.rb +246 -0
- data/lib/sendmux_management_generated/models/provider_update_body.rb +537 -0
- data/lib/sendmux_management_generated/models/provider_usage.rb +216 -0
- data/lib/sendmux_management_generated/models/provider_usage_item.rb +374 -0
- data/lib/sendmux_management_generated/models/provider_usage_response.rb +223 -0
- data/lib/sendmux_management_generated/models/resource_limit_snapshot.rb +420 -0
- data/lib/sendmux_management_generated/models/response_meta.rb +164 -0
- data/lib/sendmux_management_generated/models/sending_account_limit_request.rb +190 -0
- data/lib/sendmux_management_generated/models/sending_account_limit_request_response.rb +223 -0
- data/lib/sendmux_management_generated/models/set_filter_state_body.rb +226 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit.rb +315 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request.rb +361 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create.rb +190 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_request.rb +368 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_response.rb +223 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page.rb +176 -0
- data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page_response.rb +223 -0
- data/lib/sendmux_management_generated/models/spend_summary.rb +292 -0
- data/lib/sendmux_management_generated/models/spend_summary_response.rb +223 -0
- data/lib/sendmux_management_generated/models/success_envelope.rb +192 -0
- data/lib/sendmux_management_generated/models/transaction.rb +332 -0
- data/lib/sendmux_management_generated/models/transaction_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/update_mailbox_body.rb +210 -0
- data/lib/sendmux_management_generated/models/webhook_create_body.rb +269 -0
- data/lib/sendmux_management_generated/models/webhook_deleted_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_attempt.rb +562 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_attempt_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_payload.rb +359 -0
- data/lib/sendmux_management_generated/models/webhook_delivery_payload_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_event_data.rb +395 -0
- data/lib/sendmux_management_generated/models/webhook_event_payload.rb +297 -0
- data/lib/sendmux_management_generated/models/webhook_filters.rb +168 -0
- data/lib/sendmux_management_generated/models/webhook_subscription.rb +380 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_cursor_list_response.rb +251 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_with_secret.rb +414 -0
- data/lib/sendmux_management_generated/models/webhook_subscription_with_secret_response.rb +223 -0
- data/lib/sendmux_management_generated/models/webhook_test_response.rb +165 -0
- data/lib/sendmux_management_generated/models/webhook_update_body.rb +233 -0
- data/lib/sendmux_management_generated/version.rb +15 -0
- data/lib/sendmux_management_generated.rb +158 -0
- metadata +247 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Management::Generated
|
|
17
|
+
# The JSON request body delivered to the webhook endpoint.
|
|
18
|
+
class WebhookEventPayload < ApiModelBase
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Stable per-event identifier. Also sent in the X-Sendmux-Event-Id header.
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
# When the event occurred.
|
|
25
|
+
attr_accessor :occurred_at
|
|
26
|
+
|
|
27
|
+
# Team that owns the event.
|
|
28
|
+
attr_accessor :team_public_id
|
|
29
|
+
|
|
30
|
+
# Dotted event type. Same value as the X-Sendmux-Event-Type header.
|
|
31
|
+
attr_accessor :type
|
|
32
|
+
|
|
33
|
+
class EnumAttributeValidator
|
|
34
|
+
attr_reader :datatype
|
|
35
|
+
attr_reader :allowable_values
|
|
36
|
+
|
|
37
|
+
def initialize(datatype, allowable_values)
|
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
|
39
|
+
case datatype.to_s
|
|
40
|
+
when /Integer/i
|
|
41
|
+
value.to_i
|
|
42
|
+
when /Float/i
|
|
43
|
+
value.to_f
|
|
44
|
+
else
|
|
45
|
+
value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def valid?(value)
|
|
51
|
+
!value || allowable_values.include?(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'data' => :'data',
|
|
59
|
+
:'id' => :'id',
|
|
60
|
+
:'occurred_at' => :'occurred_at',
|
|
61
|
+
:'team_public_id' => :'team_public_id',
|
|
62
|
+
:'type' => :'type'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'data' => :'WebhookEventData',
|
|
80
|
+
:'id' => :'String',
|
|
81
|
+
:'occurred_at' => :'String',
|
|
82
|
+
:'team_public_id' => :'String',
|
|
83
|
+
:'type' => :'String'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
])
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Initializes the object
|
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
95
|
+
def initialize(attributes = {})
|
|
96
|
+
if (!attributes.is_a?(Hash))
|
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::WebhookEventPayload` initialize method"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
101
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::WebhookEventPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
|
+
end
|
|
106
|
+
h[k.to_sym] = v
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'data')
|
|
110
|
+
self.data = attributes[:'data']
|
|
111
|
+
else
|
|
112
|
+
self.data = nil
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'id')
|
|
116
|
+
self.id = attributes[:'id']
|
|
117
|
+
else
|
|
118
|
+
self.id = nil
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'occurred_at')
|
|
122
|
+
self.occurred_at = attributes[:'occurred_at']
|
|
123
|
+
else
|
|
124
|
+
self.occurred_at = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'team_public_id')
|
|
128
|
+
self.team_public_id = attributes[:'team_public_id']
|
|
129
|
+
else
|
|
130
|
+
self.team_public_id = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'type')
|
|
134
|
+
self.type = attributes[:'type']
|
|
135
|
+
else
|
|
136
|
+
self.type = nil
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
141
|
+
# @return Array for valid properties with the reasons
|
|
142
|
+
def list_invalid_properties
|
|
143
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
144
|
+
invalid_properties = Array.new
|
|
145
|
+
if @data.nil?
|
|
146
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if @id.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @occurred_at.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "occurred_at", occurred_at cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @team_public_id.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "team_public_id", team_public_id cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if @type.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
invalid_properties
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Check to see if the all the properties in the model are valid
|
|
169
|
+
# @return true if the model is valid
|
|
170
|
+
def valid?
|
|
171
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
172
|
+
return false if @data.nil?
|
|
173
|
+
return false if @id.nil?
|
|
174
|
+
return false if @occurred_at.nil?
|
|
175
|
+
return false if @team_public_id.nil?
|
|
176
|
+
return false if @type.nil?
|
|
177
|
+
type_validator = EnumAttributeValidator.new('String', ["message.delivered", "message.bounced", "message.complained", "message.rejected", "message.delivery_delayed", "message.received", "message.received.spam", "sendmux.test", "unknown_default_open_api"])
|
|
178
|
+
return false unless type_validator.valid?(@type)
|
|
179
|
+
true
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] data Value to be assigned
|
|
184
|
+
def data=(data)
|
|
185
|
+
if data.nil?
|
|
186
|
+
fail ArgumentError, 'data cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@data = data
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] id Value to be assigned
|
|
194
|
+
def id=(id)
|
|
195
|
+
if id.nil?
|
|
196
|
+
fail ArgumentError, 'id cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@id = id
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] occurred_at Value to be assigned
|
|
204
|
+
def occurred_at=(occurred_at)
|
|
205
|
+
if occurred_at.nil?
|
|
206
|
+
fail ArgumentError, 'occurred_at cannot be nil'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
@occurred_at = occurred_at
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Custom attribute writer method with validation
|
|
213
|
+
# @param [Object] team_public_id Value to be assigned
|
|
214
|
+
def team_public_id=(team_public_id)
|
|
215
|
+
if team_public_id.nil?
|
|
216
|
+
fail ArgumentError, 'team_public_id cannot be nil'
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
@team_public_id = team_public_id
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
223
|
+
# @param [Object] type Object to be assigned
|
|
224
|
+
def type=(type)
|
|
225
|
+
validator = EnumAttributeValidator.new('String', ["message.delivered", "message.bounced", "message.complained", "message.rejected", "message.delivery_delayed", "message.received", "message.received.spam", "sendmux.test", "unknown_default_open_api"])
|
|
226
|
+
unless validator.valid?(type)
|
|
227
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
228
|
+
end
|
|
229
|
+
@type = type
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Checks equality by comparing each attribute.
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def ==(o)
|
|
235
|
+
return true if self.equal?(o)
|
|
236
|
+
self.class == o.class &&
|
|
237
|
+
data == o.data &&
|
|
238
|
+
id == o.id &&
|
|
239
|
+
occurred_at == o.occurred_at &&
|
|
240
|
+
team_public_id == o.team_public_id &&
|
|
241
|
+
type == o.type
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# @see the `==` method
|
|
245
|
+
# @param [Object] Object to be compared
|
|
246
|
+
def eql?(o)
|
|
247
|
+
self == o
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Calculates hash code according to all attributes.
|
|
251
|
+
# @return [Integer] Hash code
|
|
252
|
+
def hash
|
|
253
|
+
[data, id, occurred_at, team_public_id, type].hash
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Builds the object from hash
|
|
257
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
258
|
+
# @return [Object] Returns the model itself
|
|
259
|
+
def self.build_from_hash(attributes)
|
|
260
|
+
return nil unless attributes.is_a?(Hash)
|
|
261
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
262
|
+
transformed_hash = {}
|
|
263
|
+
openapi_types.each_pair do |key, type|
|
|
264
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
265
|
+
transformed_hash["#{key}"] = nil
|
|
266
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
267
|
+
# check to ensure the input is an array given that the attribute
|
|
268
|
+
# is documented as an array but the input is not
|
|
269
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
270
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
271
|
+
end
|
|
272
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
273
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
new(transformed_hash)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Returns the object in the form of hash
|
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
|
281
|
+
def to_hash
|
|
282
|
+
hash = {}
|
|
283
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
284
|
+
value = self.send(attr)
|
|
285
|
+
if value.nil?
|
|
286
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
287
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
hash[param] = _to_hash(value)
|
|
291
|
+
end
|
|
292
|
+
hash
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Sendmux API
|
|
3
|
+
|
|
4
|
+
#Programmatic access to your Sendmux email infrastructure.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Sendmux::Management::Generated
|
|
17
|
+
# Optional delivery scope. Empty mailbox_ids means all team mailboxes.
|
|
18
|
+
class WebhookFilters < ApiModelBase
|
|
19
|
+
# Mailbox public IDs to receive events for. Empty means all mailboxes in the team.
|
|
20
|
+
attr_accessor :mailbox_ids
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'mailbox_ids' => :'mailbox_ids'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
acceptable_attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'mailbox_ids' => :'Array<String>'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if (!attributes.is_a?(Hash))
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::WebhookFilters` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::WebhookFilters`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
64
|
+
end
|
|
65
|
+
h[k.to_sym] = v
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if attributes.key?(:'mailbox_ids')
|
|
69
|
+
if (value = attributes[:'mailbox_ids']).is_a?(Array)
|
|
70
|
+
self.mailbox_ids = value
|
|
71
|
+
end
|
|
72
|
+
else
|
|
73
|
+
self.mailbox_ids = nil
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
78
|
+
# @return Array for valid properties with the reasons
|
|
79
|
+
def list_invalid_properties
|
|
80
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
81
|
+
invalid_properties = Array.new
|
|
82
|
+
if @mailbox_ids.nil?
|
|
83
|
+
invalid_properties.push('invalid value for "mailbox_ids", mailbox_ids cannot be nil.')
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
+
return false if @mailbox_ids.nil?
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Custom attribute writer method with validation
|
|
98
|
+
# @param [Object] mailbox_ids Value to be assigned
|
|
99
|
+
def mailbox_ids=(mailbox_ids)
|
|
100
|
+
if mailbox_ids.nil?
|
|
101
|
+
fail ArgumentError, 'mailbox_ids cannot be nil'
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
@mailbox_ids = mailbox_ids
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Checks equality by comparing each attribute.
|
|
108
|
+
# @param [Object] Object to be compared
|
|
109
|
+
def ==(o)
|
|
110
|
+
return true if self.equal?(o)
|
|
111
|
+
self.class == o.class &&
|
|
112
|
+
mailbox_ids == o.mailbox_ids
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @see the `==` method
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def eql?(o)
|
|
118
|
+
self == o
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Calculates hash code according to all attributes.
|
|
122
|
+
# @return [Integer] Hash code
|
|
123
|
+
def hash
|
|
124
|
+
[mailbox_ids].hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Builds the object from hash
|
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
129
|
+
# @return [Object] Returns the model itself
|
|
130
|
+
def self.build_from_hash(attributes)
|
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
|
132
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
133
|
+
transformed_hash = {}
|
|
134
|
+
openapi_types.each_pair do |key, type|
|
|
135
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
136
|
+
transformed_hash["#{key}"] = nil
|
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
141
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
144
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
new(transformed_hash)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Returns the object in the form of hash
|
|
151
|
+
# @return [Hash] Returns the object in the form of hash
|
|
152
|
+
def to_hash
|
|
153
|
+
hash = {}
|
|
154
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
155
|
+
value = self.send(attr)
|
|
156
|
+
if value.nil?
|
|
157
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
158
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
hash[param] = _to_hash(value)
|
|
162
|
+
end
|
|
163
|
+
hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
end
|