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.
Files changed (131) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +3 -0
  4. data/lib/sendmux/management/client.rb +66 -0
  5. data/lib/sendmux/management/version.rb +7 -0
  6. data/lib/sendmux/management.rb +12 -0
  7. data/lib/sendmux_management_generated/api/billing_api.rb +221 -0
  8. data/lib/sendmux_management_generated/api/domain_filters_api.rb +161 -0
  9. data/lib/sendmux_management_generated/api/domains_api.rb +419 -0
  10. data/lib/sendmux_management_generated/api/emails_api.rb +258 -0
  11. data/lib/sendmux_management_generated/api/inboxes_api.rb +175 -0
  12. data/lib/sendmux_management_generated/api/mailbox_filters_api.rb +161 -0
  13. data/lib/sendmux_management_generated/api/mailboxes_api.rb +659 -0
  14. data/lib/sendmux_management_generated/api/sending_accounts_api.rb +946 -0
  15. data/lib/sendmux_management_generated/api/webhooks_api.rb +666 -0
  16. data/lib/sendmux_management_generated/api_client.rb +441 -0
  17. data/lib/sendmux_management_generated/api_error.rb +58 -0
  18. data/lib/sendmux_management_generated/api_model_base.rb +88 -0
  19. data/lib/sendmux_management_generated/configuration.rb +393 -0
  20. data/lib/sendmux_management_generated/models/api_error_detail.rb +219 -0
  21. data/lib/sendmux_management_generated/models/api_error_error.rb +275 -0
  22. data/lib/sendmux_management_generated/models/api_error_meta.rb +164 -0
  23. data/lib/sendmux_management_generated/models/api_error_response.rb +216 -0
  24. data/lib/sendmux_management_generated/models/balance.rb +293 -0
  25. data/lib/sendmux_management_generated/models/balance_auto_topup.rb +226 -0
  26. data/lib/sendmux_management_generated/models/balance_response.rb +223 -0
  27. data/lib/sendmux_management_generated/models/cursor_pagination.rb +173 -0
  28. data/lib/sendmux_management_generated/models/delivery_log_item.rb +393 -0
  29. data/lib/sendmux_management_generated/models/delivery_log_item_cursor_list_response.rb +251 -0
  30. data/lib/sendmux_management_generated/models/delivery_log_item_response.rb +223 -0
  31. data/lib/sendmux_management_generated/models/domain_deleted_response.rb +223 -0
  32. data/lib/sendmux_management_generated/models/domain_deleted_response_all_of_data.rb +190 -0
  33. data/lib/sendmux_management_generated/models/domain_item_cursor_list_response.rb +251 -0
  34. data/lib/sendmux_management_generated/models/domain_item_response.rb +223 -0
  35. data/lib/sendmux_management_generated/models/domain_verify_response.rb +223 -0
  36. data/lib/sendmux_management_generated/models/email_metrics.rb +218 -0
  37. data/lib/sendmux_management_generated/models/email_metrics_comparison.rb +294 -0
  38. data/lib/sendmux_management_generated/models/email_metrics_comparison_change_pct.rb +268 -0
  39. data/lib/sendmux_management_generated/models/email_metrics_response.rb +223 -0
  40. data/lib/sendmux_management_generated/models/email_metrics_summary.rb +268 -0
  41. data/lib/sendmux_management_generated/models/email_metrics_timeseries_inner.rb +294 -0
  42. data/lib/sendmux_management_generated/models/filter_rule.rb +242 -0
  43. data/lib/sendmux_management_generated/models/filter_state.rb +218 -0
  44. data/lib/sendmux_management_generated/models/filter_state_response.rb +223 -0
  45. data/lib/sendmux_management_generated/models/incoming_log_item.rb +465 -0
  46. data/lib/sendmux_management_generated/models/incoming_log_item_cursor_list_response.rb +251 -0
  47. data/lib/sendmux_management_generated/models/incoming_log_item_response.rb +223 -0
  48. data/lib/sendmux_management_generated/models/mailbox.rb +284 -0
  49. data/lib/sendmux_management_generated/models/mailbox_app_password_result.rb +164 -0
  50. data/lib/sendmux_management_generated/models/mailbox_app_password_result_credential.rb +359 -0
  51. data/lib/sendmux_management_generated/models/mailbox_app_password_result_response.rb +223 -0
  52. data/lib/sendmux_management_generated/models/mailbox_create_result.rb +189 -0
  53. data/lib/sendmux_management_generated/models/mailbox_create_result_response.rb +223 -0
  54. data/lib/sendmux_management_generated/models/mailbox_credential.rb +353 -0
  55. data/lib/sendmux_management_generated/models/mailbox_deleted_response.rb +223 -0
  56. data/lib/sendmux_management_generated/models/mailbox_domain.rb +358 -0
  57. data/lib/sendmux_management_generated/models/mailbox_domain_dns_records.rb +276 -0
  58. data/lib/sendmux_management_generated/models/mailbox_domain_mx_record.rb +190 -0
  59. data/lib/sendmux_management_generated/models/mailbox_domain_name_value_record.rb +191 -0
  60. data/lib/sendmux_management_generated/models/mailbox_domain_verify_checks.rb +246 -0
  61. data/lib/sendmux_management_generated/models/mailbox_domain_verify_result.rb +242 -0
  62. data/lib/sendmux_management_generated/models/mailbox_item_cursor_list_response.rb +251 -0
  63. data/lib/sendmux_management_generated/models/mailbox_item_response.rb +223 -0
  64. data/lib/sendmux_management_generated/models/mailbox_key_deleted_response.rb +223 -0
  65. data/lib/sendmux_management_generated/models/mailbox_send_scope.rb +213 -0
  66. data/lib/sendmux_management_generated/models/management_create_domain_request.rb +165 -0
  67. data/lib/sendmux_management_generated/models/management_create_mailbox_key_request.rb +182 -0
  68. data/lib/sendmux_management_generated/models/management_create_mailbox_request.rb +257 -0
  69. data/lib/sendmux_management_generated/models/management_create_mailbox_request_send_scope.rb +210 -0
  70. data/lib/sendmux_management_generated/models/management_test_webhook200_response.rb +223 -0
  71. data/lib/sendmux_management_generated/models/provider_allowed_actions.rb +268 -0
  72. data/lib/sendmux_management_generated/models/provider_create_body.rb +579 -0
  73. data/lib/sendmux_management_generated/models/provider_create_body_quotas.rb +174 -0
  74. data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day.rb +104 -0
  75. data/lib/sendmux_management_generated/models/provider_create_body_quotas_per_day_any_of.rb +215 -0
  76. data/lib/sendmux_management_generated/models/provider_deleted.rb +190 -0
  77. data/lib/sendmux_management_generated/models/provider_deleted_response.rb +223 -0
  78. data/lib/sendmux_management_generated/models/provider_item.rb +695 -0
  79. data/lib/sendmux_management_generated/models/provider_item_cursor_list_response.rb +251 -0
  80. data/lib/sendmux_management_generated/models/provider_item_response.rb +223 -0
  81. data/lib/sendmux_management_generated/models/provider_limits.rb +190 -0
  82. data/lib/sendmux_management_generated/models/provider_limits_response.rb +223 -0
  83. data/lib/sendmux_management_generated/models/provider_quota_range.rb +208 -0
  84. data/lib/sendmux_management_generated/models/provider_quotas.rb +186 -0
  85. data/lib/sendmux_management_generated/models/provider_stats.rb +325 -0
  86. data/lib/sendmux_management_generated/models/provider_stats_response.rb +223 -0
  87. data/lib/sendmux_management_generated/models/provider_status_counts.rb +242 -0
  88. data/lib/sendmux_management_generated/models/provider_test_result.rb +251 -0
  89. data/lib/sendmux_management_generated/models/provider_test_result_response.rb +223 -0
  90. data/lib/sendmux_management_generated/models/provider_type_counts.rb +246 -0
  91. data/lib/sendmux_management_generated/models/provider_update_body.rb +537 -0
  92. data/lib/sendmux_management_generated/models/provider_usage.rb +216 -0
  93. data/lib/sendmux_management_generated/models/provider_usage_item.rb +374 -0
  94. data/lib/sendmux_management_generated/models/provider_usage_response.rb +223 -0
  95. data/lib/sendmux_management_generated/models/resource_limit_snapshot.rb +420 -0
  96. data/lib/sendmux_management_generated/models/response_meta.rb +164 -0
  97. data/lib/sendmux_management_generated/models/sending_account_limit_request.rb +190 -0
  98. data/lib/sendmux_management_generated/models/sending_account_limit_request_response.rb +223 -0
  99. data/lib/sendmux_management_generated/models/set_filter_state_body.rb +226 -0
  100. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit.rb +315 -0
  101. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request.rb +361 -0
  102. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create.rb +190 -0
  103. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_request.rb +368 -0
  104. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_create_response.rb +223 -0
  105. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page.rb +176 -0
  106. data/lib/sendmux_management_generated/models/shared_amazon_ses_limit_request_page_response.rb +223 -0
  107. data/lib/sendmux_management_generated/models/spend_summary.rb +292 -0
  108. data/lib/sendmux_management_generated/models/spend_summary_response.rb +223 -0
  109. data/lib/sendmux_management_generated/models/success_envelope.rb +192 -0
  110. data/lib/sendmux_management_generated/models/transaction.rb +332 -0
  111. data/lib/sendmux_management_generated/models/transaction_cursor_list_response.rb +251 -0
  112. data/lib/sendmux_management_generated/models/update_mailbox_body.rb +210 -0
  113. data/lib/sendmux_management_generated/models/webhook_create_body.rb +269 -0
  114. data/lib/sendmux_management_generated/models/webhook_deleted_response.rb +223 -0
  115. data/lib/sendmux_management_generated/models/webhook_delivery_attempt.rb +562 -0
  116. data/lib/sendmux_management_generated/models/webhook_delivery_attempt_cursor_list_response.rb +251 -0
  117. data/lib/sendmux_management_generated/models/webhook_delivery_payload.rb +359 -0
  118. data/lib/sendmux_management_generated/models/webhook_delivery_payload_response.rb +223 -0
  119. data/lib/sendmux_management_generated/models/webhook_event_data.rb +395 -0
  120. data/lib/sendmux_management_generated/models/webhook_event_payload.rb +297 -0
  121. data/lib/sendmux_management_generated/models/webhook_filters.rb +168 -0
  122. data/lib/sendmux_management_generated/models/webhook_subscription.rb +380 -0
  123. data/lib/sendmux_management_generated/models/webhook_subscription_cursor_list_response.rb +251 -0
  124. data/lib/sendmux_management_generated/models/webhook_subscription_response.rb +223 -0
  125. data/lib/sendmux_management_generated/models/webhook_subscription_with_secret.rb +414 -0
  126. data/lib/sendmux_management_generated/models/webhook_subscription_with_secret_response.rb +223 -0
  127. data/lib/sendmux_management_generated/models/webhook_test_response.rb +165 -0
  128. data/lib/sendmux_management_generated/models/webhook_update_body.rb +233 -0
  129. data/lib/sendmux_management_generated/version.rb +15 -0
  130. data/lib/sendmux_management_generated.rb +158 -0
  131. metadata +247 -0
@@ -0,0 +1,579 @@
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
+ class ProviderCreateBody < ApiModelBase
18
+ attr_accessor :from_email
19
+
20
+ attr_accessor :from_name
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :percentage
25
+
26
+ attr_accessor :quotas
27
+
28
+ attr_accessor :reply_to_email
29
+
30
+ attr_accessor :reply_to_name
31
+
32
+ attr_accessor :smtp_host
33
+
34
+ attr_accessor :smtp_password
35
+
36
+ attr_accessor :smtp_port
37
+
38
+ attr_accessor :smtp_protocol
39
+
40
+ attr_accessor :smtp_username
41
+
42
+ attr_accessor :tracking_domain
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'from_email' => :'from_email',
70
+ :'from_name' => :'from_name',
71
+ :'name' => :'name',
72
+ :'percentage' => :'percentage',
73
+ :'quotas' => :'quotas',
74
+ :'reply_to_email' => :'reply_to_email',
75
+ :'reply_to_name' => :'reply_to_name',
76
+ :'smtp_host' => :'smtp_host',
77
+ :'smtp_password' => :'smtp_password',
78
+ :'smtp_port' => :'smtp_port',
79
+ :'smtp_protocol' => :'smtp_protocol',
80
+ :'smtp_username' => :'smtp_username',
81
+ :'tracking_domain' => :'tracking_domain'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'from_email' => :'String',
99
+ :'from_name' => :'String',
100
+ :'name' => :'String',
101
+ :'percentage' => :'Integer',
102
+ :'quotas' => :'ProviderCreateBodyQuotas',
103
+ :'reply_to_email' => :'String',
104
+ :'reply_to_name' => :'String',
105
+ :'smtp_host' => :'String',
106
+ :'smtp_password' => :'String',
107
+ :'smtp_port' => :'Integer',
108
+ :'smtp_protocol' => :'String',
109
+ :'smtp_username' => :'String',
110
+ :'tracking_domain' => :'String'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ :'from_email',
118
+ :'from_name',
119
+ :'reply_to_email',
120
+ :'reply_to_name',
121
+ :'tracking_domain'
122
+ ])
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ if (!attributes.is_a?(Hash))
129
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::ProviderCreateBody` initialize method"
130
+ end
131
+
132
+ # check to see if the attribute exists and convert string to symbol for hash key
133
+ acceptable_attribute_map = self.class.acceptable_attribute_map
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!acceptable_attribute_map.key?(k.to_sym))
136
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::ProviderCreateBody`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'from_email')
142
+ self.from_email = attributes[:'from_email']
143
+ end
144
+
145
+ if attributes.key?(:'from_name')
146
+ self.from_name = attributes[:'from_name']
147
+ end
148
+
149
+ if attributes.key?(:'name')
150
+ self.name = attributes[:'name']
151
+ else
152
+ self.name = nil
153
+ end
154
+
155
+ if attributes.key?(:'percentage')
156
+ self.percentage = attributes[:'percentage']
157
+ end
158
+
159
+ if attributes.key?(:'quotas')
160
+ self.quotas = attributes[:'quotas']
161
+ end
162
+
163
+ if attributes.key?(:'reply_to_email')
164
+ self.reply_to_email = attributes[:'reply_to_email']
165
+ end
166
+
167
+ if attributes.key?(:'reply_to_name')
168
+ self.reply_to_name = attributes[:'reply_to_name']
169
+ end
170
+
171
+ if attributes.key?(:'smtp_host')
172
+ self.smtp_host = attributes[:'smtp_host']
173
+ else
174
+ self.smtp_host = nil
175
+ end
176
+
177
+ if attributes.key?(:'smtp_password')
178
+ self.smtp_password = attributes[:'smtp_password']
179
+ else
180
+ self.smtp_password = nil
181
+ end
182
+
183
+ if attributes.key?(:'smtp_port')
184
+ self.smtp_port = attributes[:'smtp_port']
185
+ else
186
+ self.smtp_port = nil
187
+ end
188
+
189
+ if attributes.key?(:'smtp_protocol')
190
+ self.smtp_protocol = attributes[:'smtp_protocol']
191
+ else
192
+ self.smtp_protocol = nil
193
+ end
194
+
195
+ if attributes.key?(:'smtp_username')
196
+ self.smtp_username = attributes[:'smtp_username']
197
+ else
198
+ self.smtp_username = nil
199
+ end
200
+
201
+ if attributes.key?(:'tracking_domain')
202
+ self.tracking_domain = attributes[:'tracking_domain']
203
+ end
204
+ end
205
+
206
+ # Show invalid properties with the reasons. Usually used together with valid?
207
+ # @return Array for valid properties with the reasons
208
+ def list_invalid_properties
209
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
210
+ invalid_properties = Array.new
211
+ if !@from_email.nil? && @from_email.to_s.length > 255
212
+ invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.')
213
+ end
214
+
215
+ if !@from_name.nil? && @from_name.to_s.length > 255
216
+ invalid_properties.push('invalid value for "from_name", the character length must be smaller than or equal to 255.')
217
+ end
218
+
219
+ if @name.nil?
220
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
221
+ end
222
+
223
+ if @name.to_s.length > 255
224
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
225
+ end
226
+
227
+ if @name.to_s.length < 1
228
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
229
+ end
230
+
231
+ if !@percentage.nil? && @percentage > 100
232
+ invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.')
233
+ end
234
+
235
+ if !@percentage.nil? && @percentage < 0
236
+ invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.')
237
+ end
238
+
239
+ if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255
240
+ invalid_properties.push('invalid value for "reply_to_email", the character length must be smaller than or equal to 255.')
241
+ end
242
+
243
+ if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255
244
+ invalid_properties.push('invalid value for "reply_to_name", the character length must be smaller than or equal to 255.')
245
+ end
246
+
247
+ if @smtp_host.nil?
248
+ invalid_properties.push('invalid value for "smtp_host", smtp_host cannot be nil.')
249
+ end
250
+
251
+ if @smtp_host.to_s.length > 255
252
+ invalid_properties.push('invalid value for "smtp_host", the character length must be smaller than or equal to 255.')
253
+ end
254
+
255
+ if @smtp_host.to_s.length < 1
256
+ invalid_properties.push('invalid value for "smtp_host", the character length must be greater than or equal to 1.')
257
+ end
258
+
259
+ if @smtp_password.nil?
260
+ invalid_properties.push('invalid value for "smtp_password", smtp_password cannot be nil.')
261
+ end
262
+
263
+ if @smtp_password.to_s.length > 500
264
+ invalid_properties.push('invalid value for "smtp_password", the character length must be smaller than or equal to 500.')
265
+ end
266
+
267
+ if @smtp_password.to_s.length < 1
268
+ invalid_properties.push('invalid value for "smtp_password", the character length must be greater than or equal to 1.')
269
+ end
270
+
271
+ if @smtp_port.nil?
272
+ invalid_properties.push('invalid value for "smtp_port", smtp_port cannot be nil.')
273
+ end
274
+
275
+ if @smtp_port > 65535
276
+ invalid_properties.push('invalid value for "smtp_port", must be smaller than or equal to 65535.')
277
+ end
278
+
279
+ if @smtp_port < 1
280
+ invalid_properties.push('invalid value for "smtp_port", must be greater than or equal to 1.')
281
+ end
282
+
283
+ if @smtp_protocol.nil?
284
+ invalid_properties.push('invalid value for "smtp_protocol", smtp_protocol cannot be nil.')
285
+ end
286
+
287
+ if @smtp_username.nil?
288
+ invalid_properties.push('invalid value for "smtp_username", smtp_username cannot be nil.')
289
+ end
290
+
291
+ if @smtp_username.to_s.length > 255
292
+ invalid_properties.push('invalid value for "smtp_username", the character length must be smaller than or equal to 255.')
293
+ end
294
+
295
+ if @smtp_username.to_s.length < 1
296
+ invalid_properties.push('invalid value for "smtp_username", the character length must be greater than or equal to 1.')
297
+ end
298
+
299
+ if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255
300
+ invalid_properties.push('invalid value for "tracking_domain", the character length must be smaller than or equal to 255.')
301
+ end
302
+
303
+ invalid_properties
304
+ end
305
+
306
+ # Check to see if the all the properties in the model are valid
307
+ # @return true if the model is valid
308
+ def valid?
309
+ warn '[DEPRECATED] the `valid?` method is obsolete'
310
+ return false if !@from_email.nil? && @from_email.to_s.length > 255
311
+ return false if !@from_name.nil? && @from_name.to_s.length > 255
312
+ return false if @name.nil?
313
+ return false if @name.to_s.length > 255
314
+ return false if @name.to_s.length < 1
315
+ return false if !@percentage.nil? && @percentage > 100
316
+ return false if !@percentage.nil? && @percentage < 0
317
+ return false if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255
318
+ return false if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255
319
+ return false if @smtp_host.nil?
320
+ return false if @smtp_host.to_s.length > 255
321
+ return false if @smtp_host.to_s.length < 1
322
+ return false if @smtp_password.nil?
323
+ return false if @smtp_password.to_s.length > 500
324
+ return false if @smtp_password.to_s.length < 1
325
+ return false if @smtp_port.nil?
326
+ return false if @smtp_port > 65535
327
+ return false if @smtp_port < 1
328
+ return false if @smtp_protocol.nil?
329
+ smtp_protocol_validator = EnumAttributeValidator.new('String', ["tls", "ssl", "none", "starttls", "unknown_default_open_api"])
330
+ return false unless smtp_protocol_validator.valid?(@smtp_protocol)
331
+ return false if @smtp_username.nil?
332
+ return false if @smtp_username.to_s.length > 255
333
+ return false if @smtp_username.to_s.length < 1
334
+ return false if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255
335
+ true
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] from_email Value to be assigned
340
+ def from_email=(from_email)
341
+ if !from_email.nil? && from_email.to_s.length > 255
342
+ fail ArgumentError, 'invalid value for "from_email", the character length must be smaller than or equal to 255.'
343
+ end
344
+
345
+ @from_email = from_email
346
+ end
347
+
348
+ # Custom attribute writer method with validation
349
+ # @param [Object] from_name Value to be assigned
350
+ def from_name=(from_name)
351
+ if !from_name.nil? && from_name.to_s.length > 255
352
+ fail ArgumentError, 'invalid value for "from_name", the character length must be smaller than or equal to 255.'
353
+ end
354
+
355
+ @from_name = from_name
356
+ end
357
+
358
+ # Custom attribute writer method with validation
359
+ # @param [Object] name Value to be assigned
360
+ def name=(name)
361
+ if name.nil?
362
+ fail ArgumentError, 'name cannot be nil'
363
+ end
364
+
365
+ if name.to_s.length > 255
366
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
367
+ end
368
+
369
+ if name.to_s.length < 1
370
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
371
+ end
372
+
373
+ @name = name
374
+ end
375
+
376
+ # Custom attribute writer method with validation
377
+ # @param [Object] percentage Value to be assigned
378
+ def percentage=(percentage)
379
+ if percentage.nil?
380
+ fail ArgumentError, 'percentage cannot be nil'
381
+ end
382
+
383
+ if percentage > 100
384
+ fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.'
385
+ end
386
+
387
+ if percentage < 0
388
+ fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.'
389
+ end
390
+
391
+ @percentage = percentage
392
+ end
393
+
394
+ # Custom attribute writer method with validation
395
+ # @param [Object] reply_to_email Value to be assigned
396
+ def reply_to_email=(reply_to_email)
397
+ if !reply_to_email.nil? && reply_to_email.to_s.length > 255
398
+ fail ArgumentError, 'invalid value for "reply_to_email", the character length must be smaller than or equal to 255.'
399
+ end
400
+
401
+ @reply_to_email = reply_to_email
402
+ end
403
+
404
+ # Custom attribute writer method with validation
405
+ # @param [Object] reply_to_name Value to be assigned
406
+ def reply_to_name=(reply_to_name)
407
+ if !reply_to_name.nil? && reply_to_name.to_s.length > 255
408
+ fail ArgumentError, 'invalid value for "reply_to_name", the character length must be smaller than or equal to 255.'
409
+ end
410
+
411
+ @reply_to_name = reply_to_name
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] smtp_host Value to be assigned
416
+ def smtp_host=(smtp_host)
417
+ if smtp_host.nil?
418
+ fail ArgumentError, 'smtp_host cannot be nil'
419
+ end
420
+
421
+ if smtp_host.to_s.length > 255
422
+ fail ArgumentError, 'invalid value for "smtp_host", the character length must be smaller than or equal to 255.'
423
+ end
424
+
425
+ if smtp_host.to_s.length < 1
426
+ fail ArgumentError, 'invalid value for "smtp_host", the character length must be greater than or equal to 1.'
427
+ end
428
+
429
+ @smtp_host = smtp_host
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] smtp_password Value to be assigned
434
+ def smtp_password=(smtp_password)
435
+ if smtp_password.nil?
436
+ fail ArgumentError, 'smtp_password cannot be nil'
437
+ end
438
+
439
+ if smtp_password.to_s.length > 500
440
+ fail ArgumentError, 'invalid value for "smtp_password", the character length must be smaller than or equal to 500.'
441
+ end
442
+
443
+ if smtp_password.to_s.length < 1
444
+ fail ArgumentError, 'invalid value for "smtp_password", the character length must be greater than or equal to 1.'
445
+ end
446
+
447
+ @smtp_password = smtp_password
448
+ end
449
+
450
+ # Custom attribute writer method with validation
451
+ # @param [Object] smtp_port Value to be assigned
452
+ def smtp_port=(smtp_port)
453
+ if smtp_port.nil?
454
+ fail ArgumentError, 'smtp_port cannot be nil'
455
+ end
456
+
457
+ if smtp_port > 65535
458
+ fail ArgumentError, 'invalid value for "smtp_port", must be smaller than or equal to 65535.'
459
+ end
460
+
461
+ if smtp_port < 1
462
+ fail ArgumentError, 'invalid value for "smtp_port", must be greater than or equal to 1.'
463
+ end
464
+
465
+ @smtp_port = smtp_port
466
+ end
467
+
468
+ # Custom attribute writer method checking allowed values (enum).
469
+ # @param [Object] smtp_protocol Object to be assigned
470
+ def smtp_protocol=(smtp_protocol)
471
+ validator = EnumAttributeValidator.new('String', ["tls", "ssl", "none", "starttls", "unknown_default_open_api"])
472
+ unless validator.valid?(smtp_protocol)
473
+ fail ArgumentError, "invalid value for \"smtp_protocol\", must be one of #{validator.allowable_values}."
474
+ end
475
+ @smtp_protocol = smtp_protocol
476
+ end
477
+
478
+ # Custom attribute writer method with validation
479
+ # @param [Object] smtp_username Value to be assigned
480
+ def smtp_username=(smtp_username)
481
+ if smtp_username.nil?
482
+ fail ArgumentError, 'smtp_username cannot be nil'
483
+ end
484
+
485
+ if smtp_username.to_s.length > 255
486
+ fail ArgumentError, 'invalid value for "smtp_username", the character length must be smaller than or equal to 255.'
487
+ end
488
+
489
+ if smtp_username.to_s.length < 1
490
+ fail ArgumentError, 'invalid value for "smtp_username", the character length must be greater than or equal to 1.'
491
+ end
492
+
493
+ @smtp_username = smtp_username
494
+ end
495
+
496
+ # Custom attribute writer method with validation
497
+ # @param [Object] tracking_domain Value to be assigned
498
+ def tracking_domain=(tracking_domain)
499
+ if !tracking_domain.nil? && tracking_domain.to_s.length > 255
500
+ fail ArgumentError, 'invalid value for "tracking_domain", the character length must be smaller than or equal to 255.'
501
+ end
502
+
503
+ @tracking_domain = tracking_domain
504
+ end
505
+
506
+ # Checks equality by comparing each attribute.
507
+ # @param [Object] Object to be compared
508
+ def ==(o)
509
+ return true if self.equal?(o)
510
+ self.class == o.class &&
511
+ from_email == o.from_email &&
512
+ from_name == o.from_name &&
513
+ name == o.name &&
514
+ percentage == o.percentage &&
515
+ quotas == o.quotas &&
516
+ reply_to_email == o.reply_to_email &&
517
+ reply_to_name == o.reply_to_name &&
518
+ smtp_host == o.smtp_host &&
519
+ smtp_password == o.smtp_password &&
520
+ smtp_port == o.smtp_port &&
521
+ smtp_protocol == o.smtp_protocol &&
522
+ smtp_username == o.smtp_username &&
523
+ tracking_domain == o.tracking_domain
524
+ end
525
+
526
+ # @see the `==` method
527
+ # @param [Object] Object to be compared
528
+ def eql?(o)
529
+ self == o
530
+ end
531
+
532
+ # Calculates hash code according to all attributes.
533
+ # @return [Integer] Hash code
534
+ def hash
535
+ [from_email, from_name, name, percentage, quotas, reply_to_email, reply_to_name, smtp_host, smtp_password, smtp_port, smtp_protocol, smtp_username, tracking_domain].hash
536
+ end
537
+
538
+ # Builds the object from hash
539
+ # @param [Hash] attributes Model attributes in the form of hash
540
+ # @return [Object] Returns the model itself
541
+ def self.build_from_hash(attributes)
542
+ return nil unless attributes.is_a?(Hash)
543
+ attributes = attributes.transform_keys(&:to_sym)
544
+ transformed_hash = {}
545
+ openapi_types.each_pair do |key, type|
546
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
547
+ transformed_hash["#{key}"] = nil
548
+ elsif type =~ /\AArray<(.*)>/i
549
+ # check to ensure the input is an array given that the attribute
550
+ # is documented as an array but the input is not
551
+ if attributes[attribute_map[key]].is_a?(Array)
552
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
553
+ end
554
+ elsif !attributes[attribute_map[key]].nil?
555
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
556
+ end
557
+ end
558
+ new(transformed_hash)
559
+ end
560
+
561
+ # Returns the object in the form of hash
562
+ # @return [Hash] Returns the object in the form of hash
563
+ def to_hash
564
+ hash = {}
565
+ self.class.attribute_map.each_pair do |attr, param|
566
+ value = self.send(attr)
567
+ if value.nil?
568
+ is_nullable = self.class.openapi_nullable.include?(attr)
569
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
570
+ end
571
+
572
+ hash[param] = _to_hash(value)
573
+ end
574
+ hash
575
+ end
576
+
577
+ end
578
+
579
+ end