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,218 @@
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 EmailMetrics < ApiModelBase
18
+ attr_accessor :comparison
19
+
20
+ attr_accessor :summary
21
+
22
+ attr_accessor :timeseries
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'comparison' => :'comparison',
28
+ :'summary' => :'summary',
29
+ :'timeseries' => :'timeseries'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'comparison' => :'EmailMetricsComparison',
47
+ :'summary' => :'EmailMetricsSummary',
48
+ :'timeseries' => :'Array<EmailMetricsTimeseriesInner>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::EmailMetrics` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::EmailMetrics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'comparison')
75
+ self.comparison = attributes[:'comparison']
76
+ else
77
+ self.comparison = nil
78
+ end
79
+
80
+ if attributes.key?(:'summary')
81
+ self.summary = attributes[:'summary']
82
+ else
83
+ self.summary = nil
84
+ end
85
+
86
+ if attributes.key?(:'timeseries')
87
+ if (value = attributes[:'timeseries']).is_a?(Array)
88
+ self.timeseries = value
89
+ end
90
+ else
91
+ self.timeseries = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @comparison.nil?
101
+ invalid_properties.push('invalid value for "comparison", comparison cannot be nil.')
102
+ end
103
+
104
+ if @summary.nil?
105
+ invalid_properties.push('invalid value for "summary", summary cannot be nil.')
106
+ end
107
+
108
+ if @timeseries.nil?
109
+ invalid_properties.push('invalid value for "timeseries", timeseries cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @comparison.nil?
120
+ return false if @summary.nil?
121
+ return false if @timeseries.nil?
122
+ true
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] comparison Value to be assigned
127
+ def comparison=(comparison)
128
+ if comparison.nil?
129
+ fail ArgumentError, 'comparison cannot be nil'
130
+ end
131
+
132
+ @comparison = comparison
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] summary Value to be assigned
137
+ def summary=(summary)
138
+ if summary.nil?
139
+ fail ArgumentError, 'summary cannot be nil'
140
+ end
141
+
142
+ @summary = summary
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] timeseries Value to be assigned
147
+ def timeseries=(timeseries)
148
+ if timeseries.nil?
149
+ fail ArgumentError, 'timeseries cannot be nil'
150
+ end
151
+
152
+ @timeseries = timeseries
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ comparison == o.comparison &&
161
+ summary == o.summary &&
162
+ timeseries == o.timeseries
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [comparison, summary, timeseries].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -0,0 +1,294 @@
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 EmailMetricsComparison < ApiModelBase
18
+ attr_accessor :change_pct
19
+
20
+ attr_accessor :failed
21
+
22
+ attr_accessor :pending
23
+
24
+ attr_accessor :rejected
25
+
26
+ attr_accessor :sent
27
+
28
+ attr_accessor :total
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'change_pct' => :'change_pct',
34
+ :'failed' => :'failed',
35
+ :'pending' => :'pending',
36
+ :'rejected' => :'rejected',
37
+ :'sent' => :'sent',
38
+ :'total' => :'total'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'change_pct' => :'EmailMetricsComparisonChangePct',
56
+ :'failed' => :'Float',
57
+ :'pending' => :'Float',
58
+ :'rejected' => :'Float',
59
+ :'sent' => :'Float',
60
+ :'total' => :'Float'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Management::Generated::EmailMetricsComparison` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Management::Generated::EmailMetricsComparison`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'change_pct')
87
+ self.change_pct = attributes[:'change_pct']
88
+ else
89
+ self.change_pct = nil
90
+ end
91
+
92
+ if attributes.key?(:'failed')
93
+ self.failed = attributes[:'failed']
94
+ else
95
+ self.failed = nil
96
+ end
97
+
98
+ if attributes.key?(:'pending')
99
+ self.pending = attributes[:'pending']
100
+ else
101
+ self.pending = nil
102
+ end
103
+
104
+ if attributes.key?(:'rejected')
105
+ self.rejected = attributes[:'rejected']
106
+ else
107
+ self.rejected = nil
108
+ end
109
+
110
+ if attributes.key?(:'sent')
111
+ self.sent = attributes[:'sent']
112
+ else
113
+ self.sent = nil
114
+ end
115
+
116
+ if attributes.key?(:'total')
117
+ self.total = attributes[:'total']
118
+ else
119
+ self.total = nil
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @change_pct.nil?
129
+ invalid_properties.push('invalid value for "change_pct", change_pct cannot be nil.')
130
+ end
131
+
132
+ if @failed.nil?
133
+ invalid_properties.push('invalid value for "failed", failed cannot be nil.')
134
+ end
135
+
136
+ if @pending.nil?
137
+ invalid_properties.push('invalid value for "pending", pending cannot be nil.')
138
+ end
139
+
140
+ if @rejected.nil?
141
+ invalid_properties.push('invalid value for "rejected", rejected cannot be nil.')
142
+ end
143
+
144
+ if @sent.nil?
145
+ invalid_properties.push('invalid value for "sent", sent cannot be nil.')
146
+ end
147
+
148
+ if @total.nil?
149
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @change_pct.nil?
160
+ return false if @failed.nil?
161
+ return false if @pending.nil?
162
+ return false if @rejected.nil?
163
+ return false if @sent.nil?
164
+ return false if @total.nil?
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] change_pct Value to be assigned
170
+ def change_pct=(change_pct)
171
+ if change_pct.nil?
172
+ fail ArgumentError, 'change_pct cannot be nil'
173
+ end
174
+
175
+ @change_pct = change_pct
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] failed Value to be assigned
180
+ def failed=(failed)
181
+ if failed.nil?
182
+ fail ArgumentError, 'failed cannot be nil'
183
+ end
184
+
185
+ @failed = failed
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] pending Value to be assigned
190
+ def pending=(pending)
191
+ if pending.nil?
192
+ fail ArgumentError, 'pending cannot be nil'
193
+ end
194
+
195
+ @pending = pending
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] rejected Value to be assigned
200
+ def rejected=(rejected)
201
+ if rejected.nil?
202
+ fail ArgumentError, 'rejected cannot be nil'
203
+ end
204
+
205
+ @rejected = rejected
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] sent Value to be assigned
210
+ def sent=(sent)
211
+ if sent.nil?
212
+ fail ArgumentError, 'sent cannot be nil'
213
+ end
214
+
215
+ @sent = sent
216
+ end
217
+
218
+ # Custom attribute writer method with validation
219
+ # @param [Object] total Value to be assigned
220
+ def total=(total)
221
+ if total.nil?
222
+ fail ArgumentError, 'total cannot be nil'
223
+ end
224
+
225
+ @total = total
226
+ end
227
+
228
+ # Checks equality by comparing each attribute.
229
+ # @param [Object] Object to be compared
230
+ def ==(o)
231
+ return true if self.equal?(o)
232
+ self.class == o.class &&
233
+ change_pct == o.change_pct &&
234
+ failed == o.failed &&
235
+ pending == o.pending &&
236
+ rejected == o.rejected &&
237
+ sent == o.sent &&
238
+ total == o.total
239
+ end
240
+
241
+ # @see the `==` method
242
+ # @param [Object] Object to be compared
243
+ def eql?(o)
244
+ self == o
245
+ end
246
+
247
+ # Calculates hash code according to all attributes.
248
+ # @return [Integer] Hash code
249
+ def hash
250
+ [change_pct, failed, pending, rejected, sent, total].hash
251
+ end
252
+
253
+ # Builds the object from hash
254
+ # @param [Hash] attributes Model attributes in the form of hash
255
+ # @return [Object] Returns the model itself
256
+ def self.build_from_hash(attributes)
257
+ return nil unless attributes.is_a?(Hash)
258
+ attributes = attributes.transform_keys(&:to_sym)
259
+ transformed_hash = {}
260
+ openapi_types.each_pair do |key, type|
261
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = nil
263
+ elsif type =~ /\AArray<(.*)>/i
264
+ # check to ensure the input is an array given that the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[attribute_map[key]].is_a?(Array)
267
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
268
+ end
269
+ elsif !attributes[attribute_map[key]].nil?
270
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
271
+ end
272
+ end
273
+ new(transformed_hash)
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ end
293
+
294
+ end