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,537 @@
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 ProviderUpdateBody < 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::ProviderUpdateBody` 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::ProviderUpdateBody`. 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
+ end
152
+
153
+ if attributes.key?(:'percentage')
154
+ self.percentage = attributes[:'percentage']
155
+ end
156
+
157
+ if attributes.key?(:'quotas')
158
+ self.quotas = attributes[:'quotas']
159
+ end
160
+
161
+ if attributes.key?(:'reply_to_email')
162
+ self.reply_to_email = attributes[:'reply_to_email']
163
+ end
164
+
165
+ if attributes.key?(:'reply_to_name')
166
+ self.reply_to_name = attributes[:'reply_to_name']
167
+ end
168
+
169
+ if attributes.key?(:'smtp_host')
170
+ self.smtp_host = attributes[:'smtp_host']
171
+ end
172
+
173
+ if attributes.key?(:'smtp_password')
174
+ self.smtp_password = attributes[:'smtp_password']
175
+ end
176
+
177
+ if attributes.key?(:'smtp_port')
178
+ self.smtp_port = attributes[:'smtp_port']
179
+ end
180
+
181
+ if attributes.key?(:'smtp_protocol')
182
+ self.smtp_protocol = attributes[:'smtp_protocol']
183
+ end
184
+
185
+ if attributes.key?(:'smtp_username')
186
+ self.smtp_username = attributes[:'smtp_username']
187
+ end
188
+
189
+ if attributes.key?(:'tracking_domain')
190
+ self.tracking_domain = attributes[:'tracking_domain']
191
+ end
192
+ end
193
+
194
+ # Show invalid properties with the reasons. Usually used together with valid?
195
+ # @return Array for valid properties with the reasons
196
+ def list_invalid_properties
197
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
198
+ invalid_properties = Array.new
199
+ if !@from_email.nil? && @from_email.to_s.length > 255
200
+ invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.')
201
+ end
202
+
203
+ if !@from_name.nil? && @from_name.to_s.length > 255
204
+ invalid_properties.push('invalid value for "from_name", the character length must be smaller than or equal to 255.')
205
+ end
206
+
207
+ if !@name.nil? && @name.to_s.length > 255
208
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
209
+ end
210
+
211
+ if !@name.nil? && @name.to_s.length < 1
212
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
213
+ end
214
+
215
+ if !@percentage.nil? && @percentage > 100
216
+ invalid_properties.push('invalid value for "percentage", must be smaller than or equal to 100.')
217
+ end
218
+
219
+ if !@percentage.nil? && @percentage < 0
220
+ invalid_properties.push('invalid value for "percentage", must be greater than or equal to 0.')
221
+ end
222
+
223
+ if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255
224
+ invalid_properties.push('invalid value for "reply_to_email", the character length must be smaller than or equal to 255.')
225
+ end
226
+
227
+ if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255
228
+ invalid_properties.push('invalid value for "reply_to_name", the character length must be smaller than or equal to 255.')
229
+ end
230
+
231
+ if !@smtp_host.nil? && @smtp_host.to_s.length > 255
232
+ invalid_properties.push('invalid value for "smtp_host", the character length must be smaller than or equal to 255.')
233
+ end
234
+
235
+ if !@smtp_host.nil? && @smtp_host.to_s.length < 1
236
+ invalid_properties.push('invalid value for "smtp_host", the character length must be greater than or equal to 1.')
237
+ end
238
+
239
+ if !@smtp_password.nil? && @smtp_password.to_s.length > 500
240
+ invalid_properties.push('invalid value for "smtp_password", the character length must be smaller than or equal to 500.')
241
+ end
242
+
243
+ if !@smtp_password.nil? && @smtp_password.to_s.length < 1
244
+ invalid_properties.push('invalid value for "smtp_password", the character length must be greater than or equal to 1.')
245
+ end
246
+
247
+ if !@smtp_port.nil? && @smtp_port > 65535
248
+ invalid_properties.push('invalid value for "smtp_port", must be smaller than or equal to 65535.')
249
+ end
250
+
251
+ if !@smtp_port.nil? && @smtp_port < 1
252
+ invalid_properties.push('invalid value for "smtp_port", must be greater than or equal to 1.')
253
+ end
254
+
255
+ if !@smtp_username.nil? && @smtp_username.to_s.length > 255
256
+ invalid_properties.push('invalid value for "smtp_username", the character length must be smaller than or equal to 255.')
257
+ end
258
+
259
+ if !@smtp_username.nil? && @smtp_username.to_s.length < 1
260
+ invalid_properties.push('invalid value for "smtp_username", the character length must be greater than or equal to 1.')
261
+ end
262
+
263
+ if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255
264
+ invalid_properties.push('invalid value for "tracking_domain", the character length must be smaller than or equal to 255.')
265
+ end
266
+
267
+ invalid_properties
268
+ end
269
+
270
+ # Check to see if the all the properties in the model are valid
271
+ # @return true if the model is valid
272
+ def valid?
273
+ warn '[DEPRECATED] the `valid?` method is obsolete'
274
+ return false if !@from_email.nil? && @from_email.to_s.length > 255
275
+ return false if !@from_name.nil? && @from_name.to_s.length > 255
276
+ return false if !@name.nil? && @name.to_s.length > 255
277
+ return false if !@name.nil? && @name.to_s.length < 1
278
+ return false if !@percentage.nil? && @percentage > 100
279
+ return false if !@percentage.nil? && @percentage < 0
280
+ return false if !@reply_to_email.nil? && @reply_to_email.to_s.length > 255
281
+ return false if !@reply_to_name.nil? && @reply_to_name.to_s.length > 255
282
+ return false if !@smtp_host.nil? && @smtp_host.to_s.length > 255
283
+ return false if !@smtp_host.nil? && @smtp_host.to_s.length < 1
284
+ return false if !@smtp_password.nil? && @smtp_password.to_s.length > 500
285
+ return false if !@smtp_password.nil? && @smtp_password.to_s.length < 1
286
+ return false if !@smtp_port.nil? && @smtp_port > 65535
287
+ return false if !@smtp_port.nil? && @smtp_port < 1
288
+ smtp_protocol_validator = EnumAttributeValidator.new('String', ["tls", "ssl", "none", "starttls", "unknown_default_open_api"])
289
+ return false unless smtp_protocol_validator.valid?(@smtp_protocol)
290
+ return false if !@smtp_username.nil? && @smtp_username.to_s.length > 255
291
+ return false if !@smtp_username.nil? && @smtp_username.to_s.length < 1
292
+ return false if !@tracking_domain.nil? && @tracking_domain.to_s.length > 255
293
+ true
294
+ end
295
+
296
+ # Custom attribute writer method with validation
297
+ # @param [Object] from_email Value to be assigned
298
+ def from_email=(from_email)
299
+ if !from_email.nil? && from_email.to_s.length > 255
300
+ fail ArgumentError, 'invalid value for "from_email", the character length must be smaller than or equal to 255.'
301
+ end
302
+
303
+ @from_email = from_email
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] from_name Value to be assigned
308
+ def from_name=(from_name)
309
+ if !from_name.nil? && from_name.to_s.length > 255
310
+ fail ArgumentError, 'invalid value for "from_name", the character length must be smaller than or equal to 255.'
311
+ end
312
+
313
+ @from_name = from_name
314
+ end
315
+
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] name Value to be assigned
318
+ def name=(name)
319
+ if name.nil?
320
+ fail ArgumentError, 'name cannot be nil'
321
+ end
322
+
323
+ if name.to_s.length > 255
324
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
325
+ end
326
+
327
+ if name.to_s.length < 1
328
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
329
+ end
330
+
331
+ @name = name
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] percentage Value to be assigned
336
+ def percentage=(percentage)
337
+ if percentage.nil?
338
+ fail ArgumentError, 'percentage cannot be nil'
339
+ end
340
+
341
+ if percentage > 100
342
+ fail ArgumentError, 'invalid value for "percentage", must be smaller than or equal to 100.'
343
+ end
344
+
345
+ if percentage < 0
346
+ fail ArgumentError, 'invalid value for "percentage", must be greater than or equal to 0.'
347
+ end
348
+
349
+ @percentage = percentage
350
+ end
351
+
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] reply_to_email Value to be assigned
354
+ def reply_to_email=(reply_to_email)
355
+ if !reply_to_email.nil? && reply_to_email.to_s.length > 255
356
+ fail ArgumentError, 'invalid value for "reply_to_email", the character length must be smaller than or equal to 255.'
357
+ end
358
+
359
+ @reply_to_email = reply_to_email
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] reply_to_name Value to be assigned
364
+ def reply_to_name=(reply_to_name)
365
+ if !reply_to_name.nil? && reply_to_name.to_s.length > 255
366
+ fail ArgumentError, 'invalid value for "reply_to_name", the character length must be smaller than or equal to 255.'
367
+ end
368
+
369
+ @reply_to_name = reply_to_name
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] smtp_host Value to be assigned
374
+ def smtp_host=(smtp_host)
375
+ if smtp_host.nil?
376
+ fail ArgumentError, 'smtp_host cannot be nil'
377
+ end
378
+
379
+ if smtp_host.to_s.length > 255
380
+ fail ArgumentError, 'invalid value for "smtp_host", the character length must be smaller than or equal to 255.'
381
+ end
382
+
383
+ if smtp_host.to_s.length < 1
384
+ fail ArgumentError, 'invalid value for "smtp_host", the character length must be greater than or equal to 1.'
385
+ end
386
+
387
+ @smtp_host = smtp_host
388
+ end
389
+
390
+ # Custom attribute writer method with validation
391
+ # @param [Object] smtp_password Value to be assigned
392
+ def smtp_password=(smtp_password)
393
+ if smtp_password.nil?
394
+ fail ArgumentError, 'smtp_password cannot be nil'
395
+ end
396
+
397
+ if smtp_password.to_s.length > 500
398
+ fail ArgumentError, 'invalid value for "smtp_password", the character length must be smaller than or equal to 500.'
399
+ end
400
+
401
+ if smtp_password.to_s.length < 1
402
+ fail ArgumentError, 'invalid value for "smtp_password", the character length must be greater than or equal to 1.'
403
+ end
404
+
405
+ @smtp_password = smtp_password
406
+ end
407
+
408
+ # Custom attribute writer method with validation
409
+ # @param [Object] smtp_port Value to be assigned
410
+ def smtp_port=(smtp_port)
411
+ if smtp_port.nil?
412
+ fail ArgumentError, 'smtp_port cannot be nil'
413
+ end
414
+
415
+ if smtp_port > 65535
416
+ fail ArgumentError, 'invalid value for "smtp_port", must be smaller than or equal to 65535.'
417
+ end
418
+
419
+ if smtp_port < 1
420
+ fail ArgumentError, 'invalid value for "smtp_port", must be greater than or equal to 1.'
421
+ end
422
+
423
+ @smtp_port = smtp_port
424
+ end
425
+
426
+ # Custom attribute writer method checking allowed values (enum).
427
+ # @param [Object] smtp_protocol Object to be assigned
428
+ def smtp_protocol=(smtp_protocol)
429
+ validator = EnumAttributeValidator.new('String', ["tls", "ssl", "none", "starttls", "unknown_default_open_api"])
430
+ unless validator.valid?(smtp_protocol)
431
+ fail ArgumentError, "invalid value for \"smtp_protocol\", must be one of #{validator.allowable_values}."
432
+ end
433
+ @smtp_protocol = smtp_protocol
434
+ end
435
+
436
+ # Custom attribute writer method with validation
437
+ # @param [Object] smtp_username Value to be assigned
438
+ def smtp_username=(smtp_username)
439
+ if smtp_username.nil?
440
+ fail ArgumentError, 'smtp_username cannot be nil'
441
+ end
442
+
443
+ if smtp_username.to_s.length > 255
444
+ fail ArgumentError, 'invalid value for "smtp_username", the character length must be smaller than or equal to 255.'
445
+ end
446
+
447
+ if smtp_username.to_s.length < 1
448
+ fail ArgumentError, 'invalid value for "smtp_username", the character length must be greater than or equal to 1.'
449
+ end
450
+
451
+ @smtp_username = smtp_username
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] tracking_domain Value to be assigned
456
+ def tracking_domain=(tracking_domain)
457
+ if !tracking_domain.nil? && tracking_domain.to_s.length > 255
458
+ fail ArgumentError, 'invalid value for "tracking_domain", the character length must be smaller than or equal to 255.'
459
+ end
460
+
461
+ @tracking_domain = tracking_domain
462
+ end
463
+
464
+ # Checks equality by comparing each attribute.
465
+ # @param [Object] Object to be compared
466
+ def ==(o)
467
+ return true if self.equal?(o)
468
+ self.class == o.class &&
469
+ from_email == o.from_email &&
470
+ from_name == o.from_name &&
471
+ name == o.name &&
472
+ percentage == o.percentage &&
473
+ quotas == o.quotas &&
474
+ reply_to_email == o.reply_to_email &&
475
+ reply_to_name == o.reply_to_name &&
476
+ smtp_host == o.smtp_host &&
477
+ smtp_password == o.smtp_password &&
478
+ smtp_port == o.smtp_port &&
479
+ smtp_protocol == o.smtp_protocol &&
480
+ smtp_username == o.smtp_username &&
481
+ tracking_domain == o.tracking_domain
482
+ end
483
+
484
+ # @see the `==` method
485
+ # @param [Object] Object to be compared
486
+ def eql?(o)
487
+ self == o
488
+ end
489
+
490
+ # Calculates hash code according to all attributes.
491
+ # @return [Integer] Hash code
492
+ def hash
493
+ [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
494
+ end
495
+
496
+ # Builds the object from hash
497
+ # @param [Hash] attributes Model attributes in the form of hash
498
+ # @return [Object] Returns the model itself
499
+ def self.build_from_hash(attributes)
500
+ return nil unless attributes.is_a?(Hash)
501
+ attributes = attributes.transform_keys(&:to_sym)
502
+ transformed_hash = {}
503
+ openapi_types.each_pair do |key, type|
504
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
505
+ transformed_hash["#{key}"] = nil
506
+ elsif type =~ /\AArray<(.*)>/i
507
+ # check to ensure the input is an array given that the attribute
508
+ # is documented as an array but the input is not
509
+ if attributes[attribute_map[key]].is_a?(Array)
510
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
511
+ end
512
+ elsif !attributes[attribute_map[key]].nil?
513
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
514
+ end
515
+ end
516
+ new(transformed_hash)
517
+ end
518
+
519
+ # Returns the object in the form of hash
520
+ # @return [Hash] Returns the object in the form of hash
521
+ def to_hash
522
+ hash = {}
523
+ self.class.attribute_map.each_pair do |attr, param|
524
+ value = self.send(attr)
525
+ if value.nil?
526
+ is_nullable = self.class.openapi_nullable.include?(attr)
527
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
528
+ end
529
+
530
+ hash[param] = _to_hash(value)
531
+ end
532
+ hash
533
+ end
534
+
535
+ end
536
+
537
+ end