qubrics-management 3.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 (161) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +100 -0
  3. data/LICENSE +21 -0
  4. data/README.md +157 -0
  5. data/lib/qubrics/management/client.rb +99 -0
  6. data/lib/qubrics/management/version.rb +7 -0
  7. data/lib/qubrics/management.rb +12 -0
  8. data/lib/qubrics_management_generated/api/billing_api.rb +221 -0
  9. data/lib/qubrics_management_generated/api/connection_api.rb +82 -0
  10. data/lib/qubrics_management_generated/api/domain_filters_api.rb +161 -0
  11. data/lib/qubrics_management_generated/api/domains_api.rb +492 -0
  12. data/lib/qubrics_management_generated/api/emails_api.rb +258 -0
  13. data/lib/qubrics_management_generated/api/inboxes_api.rb +175 -0
  14. data/lib/qubrics_management_generated/api/mailbox_filters_api.rb +161 -0
  15. data/lib/qubrics_management_generated/api/mailboxes_api.rb +996 -0
  16. data/lib/qubrics_management_generated/api/sending_accounts_api.rb +1009 -0
  17. data/lib/qubrics_management_generated/api/webhooks_api.rb +666 -0
  18. data/lib/qubrics_management_generated/api_client.rb +447 -0
  19. data/lib/qubrics_management_generated/api_error.rb +58 -0
  20. data/lib/qubrics_management_generated/api_model_base.rb +95 -0
  21. data/lib/qubrics_management_generated/configuration.rb +400 -0
  22. data/lib/qubrics_management_generated/models/api_error_detail.rb +219 -0
  23. data/lib/qubrics_management_generated/models/api_error_error.rb +275 -0
  24. data/lib/qubrics_management_generated/models/api_error_meta.rb +164 -0
  25. data/lib/qubrics_management_generated/models/api_error_response.rb +216 -0
  26. data/lib/qubrics_management_generated/models/balance.rb +293 -0
  27. data/lib/qubrics_management_generated/models/balance_auto_topup.rb +226 -0
  28. data/lib/qubrics_management_generated/models/balance_response.rb +223 -0
  29. data/lib/qubrics_management_generated/models/connection.rb +273 -0
  30. data/lib/qubrics_management_generated/models/connection_credential.rb +226 -0
  31. data/lib/qubrics_management_generated/models/connection_mailboxes_inner.rb +190 -0
  32. data/lib/qubrics_management_generated/models/connection_response.rb +223 -0
  33. data/lib/qubrics_management_generated/models/connection_team.rb +190 -0
  34. data/lib/qubrics_management_generated/models/cursor_pagination.rb +173 -0
  35. data/lib/qubrics_management_generated/models/delivery_log_detail.rb +573 -0
  36. data/lib/qubrics_management_generated/models/delivery_log_item.rb +543 -0
  37. data/lib/qubrics_management_generated/models/delivery_log_item_cursor_list_response.rb +251 -0
  38. data/lib/qubrics_management_generated/models/delivery_log_item_response.rb +223 -0
  39. data/lib/qubrics_management_generated/models/delivery_log_recipient.rb +254 -0
  40. data/lib/qubrics_management_generated/models/domain_deleted_response.rb +223 -0
  41. data/lib/qubrics_management_generated/models/domain_deleted_response_all_of_data.rb +190 -0
  42. data/lib/qubrics_management_generated/models/domain_item_cursor_list_response.rb +251 -0
  43. data/lib/qubrics_management_generated/models/domain_item_response.rb +223 -0
  44. data/lib/qubrics_management_generated/models/domain_verify_response.rb +223 -0
  45. data/lib/qubrics_management_generated/models/email_metrics.rb +218 -0
  46. data/lib/qubrics_management_generated/models/email_metrics_comparison.rb +294 -0
  47. data/lib/qubrics_management_generated/models/email_metrics_comparison_change_pct.rb +268 -0
  48. data/lib/qubrics_management_generated/models/email_metrics_response.rb +223 -0
  49. data/lib/qubrics_management_generated/models/email_metrics_summary.rb +268 -0
  50. data/lib/qubrics_management_generated/models/email_metrics_timeseries_inner.rb +294 -0
  51. data/lib/qubrics_management_generated/models/filter_rule.rb +242 -0
  52. data/lib/qubrics_management_generated/models/filter_state.rb +218 -0
  53. data/lib/qubrics_management_generated/models/filter_state_response.rb +223 -0
  54. data/lib/qubrics_management_generated/models/incoming_log_item.rb +465 -0
  55. data/lib/qubrics_management_generated/models/incoming_log_item_cursor_list_response.rb +251 -0
  56. data/lib/qubrics_management_generated/models/incoming_log_item_response.rb +223 -0
  57. data/lib/qubrics_management_generated/models/mail_webhook_event_payload.rb +296 -0
  58. data/lib/qubrics_management_generated/models/mailbox.rb +284 -0
  59. data/lib/qubrics_management_generated/models/mailbox_app_password_result.rb +164 -0
  60. data/lib/qubrics_management_generated/models/mailbox_app_password_result_response.rb +223 -0
  61. data/lib/qubrics_management_generated/models/mailbox_availability_reason.rb +45 -0
  62. data/lib/qubrics_management_generated/models/mailbox_availability_response.rb +223 -0
  63. data/lib/qubrics_management_generated/models/mailbox_availability_result.rb +240 -0
  64. data/lib/qubrics_management_generated/models/mailbox_cost_usage.rb +409 -0
  65. data/lib/qubrics_management_generated/models/mailbox_cost_usage_incoming.rb +422 -0
  66. data/lib/qubrics_management_generated/models/mailbox_cost_usage_response.rb +223 -0
  67. data/lib/qubrics_management_generated/models/mailbox_cost_usage_storage.rb +299 -0
  68. data/lib/qubrics_management_generated/models/mailbox_create_result.rb +190 -0
  69. data/lib/qubrics_management_generated/models/mailbox_create_result_response.rb +223 -0
  70. data/lib/qubrics_management_generated/models/mailbox_credential.rb +352 -0
  71. data/lib/qubrics_management_generated/models/mailbox_deleted_response.rb +223 -0
  72. data/lib/qubrics_management_generated/models/mailbox_domain.rb +452 -0
  73. data/lib/qubrics_management_generated/models/mailbox_domain_dns_records.rb +303 -0
  74. data/lib/qubrics_management_generated/models/mailbox_domain_mail_from_records.rb +191 -0
  75. data/lib/qubrics_management_generated/models/mailbox_domain_mx_record.rb +190 -0
  76. data/lib/qubrics_management_generated/models/mailbox_domain_name_value_record.rb +191 -0
  77. data/lib/qubrics_management_generated/models/mailbox_domain_named_mx_record.rb +217 -0
  78. data/lib/qubrics_management_generated/models/mailbox_domain_verify_checks.rb +300 -0
  79. data/lib/qubrics_management_generated/models/mailbox_domain_verify_result.rb +377 -0
  80. data/lib/qubrics_management_generated/models/mailbox_item_cursor_list_response.rb +251 -0
  81. data/lib/qubrics_management_generated/models/mailbox_item_response.rb +223 -0
  82. data/lib/qubrics_management_generated/models/mailbox_key_deleted_response.rb +223 -0
  83. data/lib/qubrics_management_generated/models/mailbox_send_policy.rb +196 -0
  84. data/lib/qubrics_management_generated/models/mailbox_send_policy_allowed_from.rb +213 -0
  85. data/lib/qubrics_management_generated/models/mailbox_send_policy_allowed_reply_to.rb +213 -0
  86. data/lib/qubrics_management_generated/models/mailbox_send_policy_recipients.rb +158 -0
  87. data/lib/qubrics_management_generated/models/mailbox_send_policy_recipients_allow.rb +201 -0
  88. data/lib/qubrics_management_generated/models/mailbox_send_policy_recipients_deny.rb +201 -0
  89. data/lib/qubrics_management_generated/models/mailbox_send_policy_response.rb +223 -0
  90. data/lib/qubrics_management_generated/models/mailbox_send_policy_snapshot.rb +202 -0
  91. data/lib/qubrics_management_generated/models/mailbox_send_scope.rb +213 -0
  92. data/lib/qubrics_management_generated/models/management_create_domain_request.rb +209 -0
  93. data/lib/qubrics_management_generated/models/management_create_mailbox_key_request.rb +183 -0
  94. data/lib/qubrics_management_generated/models/management_create_mailbox_request.rb +270 -0
  95. data/lib/qubrics_management_generated/models/management_create_mailbox_request_send_scope.rb +214 -0
  96. data/lib/qubrics_management_generated/models/management_test_webhook200_response.rb +223 -0
  97. data/lib/qubrics_management_generated/models/management_update_domain_request.rb +189 -0
  98. data/lib/qubrics_management_generated/models/provider_allowed_actions.rb +294 -0
  99. data/lib/qubrics_management_generated/models/provider_create_body.rb +611 -0
  100. data/lib/qubrics_management_generated/models/provider_create_body_quotas.rb +174 -0
  101. data/lib/qubrics_management_generated/models/provider_create_body_quotas_per_day.rb +104 -0
  102. data/lib/qubrics_management_generated/models/provider_deleted.rb +190 -0
  103. data/lib/qubrics_management_generated/models/provider_deleted_response.rb +223 -0
  104. data/lib/qubrics_management_generated/models/provider_item.rb +733 -0
  105. data/lib/qubrics_management_generated/models/provider_item_cursor_list_response.rb +251 -0
  106. data/lib/qubrics_management_generated/models/provider_item_response.rb +223 -0
  107. data/lib/qubrics_management_generated/models/provider_limits.rb +190 -0
  108. data/lib/qubrics_management_generated/models/provider_limits_response.rb +223 -0
  109. data/lib/qubrics_management_generated/models/provider_list_item.rb +695 -0
  110. data/lib/qubrics_management_generated/models/provider_quota_range.rb +208 -0
  111. data/lib/qubrics_management_generated/models/provider_quotas.rb +186 -0
  112. data/lib/qubrics_management_generated/models/provider_stats.rb +325 -0
  113. data/lib/qubrics_management_generated/models/provider_stats_response.rb +223 -0
  114. data/lib/qubrics_management_generated/models/provider_status_counts.rb +242 -0
  115. data/lib/qubrics_management_generated/models/provider_test_result.rb +251 -0
  116. data/lib/qubrics_management_generated/models/provider_test_result_response.rb +223 -0
  117. data/lib/qubrics_management_generated/models/provider_type_counts.rb +246 -0
  118. data/lib/qubrics_management_generated/models/provider_update_body.rb +569 -0
  119. data/lib/qubrics_management_generated/models/provider_usage.rb +216 -0
  120. data/lib/qubrics_management_generated/models/provider_usage_item.rb +374 -0
  121. data/lib/qubrics_management_generated/models/provider_usage_response.rb +223 -0
  122. data/lib/qubrics_management_generated/models/replace_mailbox_send_policy.rb +165 -0
  123. data/lib/qubrics_management_generated/models/resource_limit_snapshot.rb +420 -0
  124. data/lib/qubrics_management_generated/models/response_meta.rb +164 -0
  125. data/lib/qubrics_management_generated/models/sending_account_limit_request.rb +190 -0
  126. data/lib/qubrics_management_generated/models/sending_account_limit_request_response.rb +223 -0
  127. data/lib/qubrics_management_generated/models/set_filter_state_body.rb +226 -0
  128. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit.rb +315 -0
  129. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request.rb +361 -0
  130. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_cancel.rb +190 -0
  131. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_cancel_response.rb +223 -0
  132. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_create.rb +190 -0
  133. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_create_response.rb +223 -0
  134. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_page.rb +176 -0
  135. data/lib/qubrics_management_generated/models/shared_amazon_ses_limit_request_page_response.rb +223 -0
  136. data/lib/qubrics_management_generated/models/spend_summary.rb +292 -0
  137. data/lib/qubrics_management_generated/models/spend_summary_response.rb +223 -0
  138. data/lib/qubrics_management_generated/models/success_envelope.rb +192 -0
  139. data/lib/qubrics_management_generated/models/transaction.rb +332 -0
  140. data/lib/qubrics_management_generated/models/transaction_cursor_list_response.rb +251 -0
  141. data/lib/qubrics_management_generated/models/update_mailbox_body.rb +211 -0
  142. data/lib/qubrics_management_generated/models/update_mailbox_body_send_scope.rb +214 -0
  143. data/lib/qubrics_management_generated/models/webhook_create_body.rb +269 -0
  144. data/lib/qubrics_management_generated/models/webhook_deleted_response.rb +223 -0
  145. data/lib/qubrics_management_generated/models/webhook_delivery_attempt.rb +560 -0
  146. data/lib/qubrics_management_generated/models/webhook_delivery_attempt_cursor_list_response.rb +251 -0
  147. data/lib/qubrics_management_generated/models/webhook_delivery_payload.rb +337 -0
  148. data/lib/qubrics_management_generated/models/webhook_delivery_payload_response.rb +223 -0
  149. data/lib/qubrics_management_generated/models/webhook_event_data.rb +406 -0
  150. data/lib/qubrics_management_generated/models/webhook_event_payload.rb +304 -0
  151. data/lib/qubrics_management_generated/models/webhook_filters.rb +168 -0
  152. data/lib/qubrics_management_generated/models/webhook_subscription.rb +368 -0
  153. data/lib/qubrics_management_generated/models/webhook_subscription_cursor_list_response.rb +251 -0
  154. data/lib/qubrics_management_generated/models/webhook_subscription_response.rb +223 -0
  155. data/lib/qubrics_management_generated/models/webhook_subscription_with_secret.rb +395 -0
  156. data/lib/qubrics_management_generated/models/webhook_subscription_with_secret_response.rb +223 -0
  157. data/lib/qubrics_management_generated/models/webhook_test_response.rb +165 -0
  158. data/lib/qubrics_management_generated/models/webhook_update_body.rb +233 -0
  159. data/lib/qubrics_management_generated/version.rb +15 -0
  160. data/lib/qubrics_management_generated.rb +195 -0
  161. metadata +283 -0
@@ -0,0 +1,422 @@
1
+ =begin
2
+ #Qubrics API
3
+
4
+ #Programmatic access to your Qubrics 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 Qubrics::Management::Generated
17
+ class MailboxCostUsageIncoming < ApiModelBase
18
+ attr_accessor :coverage_started_at
19
+
20
+ attr_accessor :incurred_amount
21
+
22
+ attr_accessor :posted_amount
23
+
24
+ attr_accessor :posted_quantity
25
+
26
+ attr_accessor :quantity
27
+
28
+ attr_accessor :state
29
+
30
+ attr_accessor :unbillable_amount
31
+
32
+ attr_accessor :unbillable_quantity
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'coverage_started_at' => :'coverage_started_at',
60
+ :'incurred_amount' => :'incurred_amount',
61
+ :'posted_amount' => :'posted_amount',
62
+ :'posted_quantity' => :'posted_quantity',
63
+ :'quantity' => :'quantity',
64
+ :'state' => :'state',
65
+ :'unbillable_amount' => :'unbillable_amount',
66
+ :'unbillable_quantity' => :'unbillable_quantity'
67
+ }
68
+ end
69
+
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'coverage_started_at' => :'Time',
84
+ :'incurred_amount' => :'String',
85
+ :'posted_amount' => :'String',
86
+ :'posted_quantity' => :'String',
87
+ :'quantity' => :'String',
88
+ :'state' => :'String',
89
+ :'unbillable_amount' => :'String',
90
+ :'unbillable_quantity' => :'String'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ :'coverage_started_at',
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Management::Generated::MailboxCostUsageIncoming` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ acceptable_attribute_map = self.class.acceptable_attribute_map
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!acceptable_attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Management::Generated::MailboxCostUsageIncoming`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'coverage_started_at')
118
+ self.coverage_started_at = attributes[:'coverage_started_at']
119
+ else
120
+ self.coverage_started_at = nil
121
+ end
122
+
123
+ if attributes.key?(:'incurred_amount')
124
+ self.incurred_amount = attributes[:'incurred_amount']
125
+ else
126
+ self.incurred_amount = nil
127
+ end
128
+
129
+ if attributes.key?(:'posted_amount')
130
+ self.posted_amount = attributes[:'posted_amount']
131
+ else
132
+ self.posted_amount = nil
133
+ end
134
+
135
+ if attributes.key?(:'posted_quantity')
136
+ self.posted_quantity = attributes[:'posted_quantity']
137
+ else
138
+ self.posted_quantity = nil
139
+ end
140
+
141
+ if attributes.key?(:'quantity')
142
+ self.quantity = attributes[:'quantity']
143
+ else
144
+ self.quantity = nil
145
+ end
146
+
147
+ if attributes.key?(:'state')
148
+ self.state = attributes[:'state']
149
+ else
150
+ self.state = nil
151
+ end
152
+
153
+ if attributes.key?(:'unbillable_amount')
154
+ self.unbillable_amount = attributes[:'unbillable_amount']
155
+ else
156
+ self.unbillable_amount = nil
157
+ end
158
+
159
+ if attributes.key?(:'unbillable_quantity')
160
+ self.unbillable_quantity = attributes[:'unbillable_quantity']
161
+ else
162
+ self.unbillable_quantity = nil
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
170
+ invalid_properties = Array.new
171
+ if @incurred_amount.nil?
172
+ invalid_properties.push('invalid value for "incurred_amount", incurred_amount cannot be nil.')
173
+ end
174
+
175
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
176
+ if @incurred_amount !~ pattern
177
+ invalid_properties.push("invalid value for \"incurred_amount\", must conform to the pattern #{pattern}.")
178
+ end
179
+
180
+ if @posted_amount.nil?
181
+ invalid_properties.push('invalid value for "posted_amount", posted_amount cannot be nil.')
182
+ end
183
+
184
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
185
+ if @posted_amount !~ pattern
186
+ invalid_properties.push("invalid value for \"posted_amount\", must conform to the pattern #{pattern}.")
187
+ end
188
+
189
+ if @posted_quantity.nil?
190
+ invalid_properties.push('invalid value for "posted_quantity", posted_quantity cannot be nil.')
191
+ end
192
+
193
+ pattern = Regexp.new(/^\d+$/)
194
+ if @posted_quantity !~ pattern
195
+ invalid_properties.push("invalid value for \"posted_quantity\", must conform to the pattern #{pattern}.")
196
+ end
197
+
198
+ if @quantity.nil?
199
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
200
+ end
201
+
202
+ pattern = Regexp.new(/^\d+$/)
203
+ if @quantity !~ pattern
204
+ invalid_properties.push("invalid value for \"quantity\", must conform to the pattern #{pattern}.")
205
+ end
206
+
207
+ if @state.nil?
208
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
209
+ end
210
+
211
+ if @unbillable_amount.nil?
212
+ invalid_properties.push('invalid value for "unbillable_amount", unbillable_amount cannot be nil.')
213
+ end
214
+
215
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
216
+ if @unbillable_amount !~ pattern
217
+ invalid_properties.push("invalid value for \"unbillable_amount\", must conform to the pattern #{pattern}.")
218
+ end
219
+
220
+ if @unbillable_quantity.nil?
221
+ invalid_properties.push('invalid value for "unbillable_quantity", unbillable_quantity cannot be nil.')
222
+ end
223
+
224
+ pattern = Regexp.new(/^\d+$/)
225
+ if @unbillable_quantity !~ pattern
226
+ invalid_properties.push("invalid value for \"unbillable_quantity\", must conform to the pattern #{pattern}.")
227
+ end
228
+
229
+ invalid_properties
230
+ end
231
+
232
+ # Check to see if the all the properties in the model are valid
233
+ # @return true if the model is valid
234
+ def valid?
235
+ warn '[DEPRECATED] the `valid?` method is obsolete'
236
+ return false if @incurred_amount.nil?
237
+ return false if @incurred_amount !~ Regexp.new(/^\d+\.\d{6}$/)
238
+ return false if @posted_amount.nil?
239
+ return false if @posted_amount !~ Regexp.new(/^\d+\.\d{6}$/)
240
+ return false if @posted_quantity.nil?
241
+ return false if @posted_quantity !~ Regexp.new(/^\d+$/)
242
+ return false if @quantity.nil?
243
+ return false if @quantity !~ Regexp.new(/^\d+$/)
244
+ return false if @state.nil?
245
+ state_validator = EnumAttributeValidator.new('String', ["pending", "final", "unknown_default_open_api"])
246
+ return false unless state_validator.valid?(@state)
247
+ return false if @unbillable_amount.nil?
248
+ return false if @unbillable_amount !~ Regexp.new(/^\d+\.\d{6}$/)
249
+ return false if @unbillable_quantity.nil?
250
+ return false if @unbillable_quantity !~ Regexp.new(/^\d+$/)
251
+ true
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] incurred_amount Value to be assigned
256
+ def incurred_amount=(incurred_amount)
257
+ if incurred_amount.nil?
258
+ fail ArgumentError, 'incurred_amount cannot be nil'
259
+ end
260
+
261
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
262
+ if incurred_amount !~ pattern
263
+ fail ArgumentError, "invalid value for \"incurred_amount\", must conform to the pattern #{pattern}."
264
+ end
265
+
266
+ @incurred_amount = incurred_amount
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] posted_amount Value to be assigned
271
+ def posted_amount=(posted_amount)
272
+ if posted_amount.nil?
273
+ fail ArgumentError, 'posted_amount cannot be nil'
274
+ end
275
+
276
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
277
+ if posted_amount !~ pattern
278
+ fail ArgumentError, "invalid value for \"posted_amount\", must conform to the pattern #{pattern}."
279
+ end
280
+
281
+ @posted_amount = posted_amount
282
+ end
283
+
284
+ # Custom attribute writer method with validation
285
+ # @param [Object] posted_quantity Value to be assigned
286
+ def posted_quantity=(posted_quantity)
287
+ if posted_quantity.nil?
288
+ fail ArgumentError, 'posted_quantity cannot be nil'
289
+ end
290
+
291
+ pattern = Regexp.new(/^\d+$/)
292
+ if posted_quantity !~ pattern
293
+ fail ArgumentError, "invalid value for \"posted_quantity\", must conform to the pattern #{pattern}."
294
+ end
295
+
296
+ @posted_quantity = posted_quantity
297
+ end
298
+
299
+ # Custom attribute writer method with validation
300
+ # @param [Object] quantity Value to be assigned
301
+ def quantity=(quantity)
302
+ if quantity.nil?
303
+ fail ArgumentError, 'quantity cannot be nil'
304
+ end
305
+
306
+ pattern = Regexp.new(/^\d+$/)
307
+ if quantity !~ pattern
308
+ fail ArgumentError, "invalid value for \"quantity\", must conform to the pattern #{pattern}."
309
+ end
310
+
311
+ @quantity = quantity
312
+ end
313
+
314
+ # Custom attribute writer method checking allowed values (enum).
315
+ # @param [Object] state Object to be assigned
316
+ def state=(state)
317
+ validator = EnumAttributeValidator.new('String', ["pending", "final", "unknown_default_open_api"])
318
+ unless validator.valid?(state)
319
+ fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
320
+ end
321
+ @state = state
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] unbillable_amount Value to be assigned
326
+ def unbillable_amount=(unbillable_amount)
327
+ if unbillable_amount.nil?
328
+ fail ArgumentError, 'unbillable_amount cannot be nil'
329
+ end
330
+
331
+ pattern = Regexp.new(/^\d+\.\d{6}$/)
332
+ if unbillable_amount !~ pattern
333
+ fail ArgumentError, "invalid value for \"unbillable_amount\", must conform to the pattern #{pattern}."
334
+ end
335
+
336
+ @unbillable_amount = unbillable_amount
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] unbillable_quantity Value to be assigned
341
+ def unbillable_quantity=(unbillable_quantity)
342
+ if unbillable_quantity.nil?
343
+ fail ArgumentError, 'unbillable_quantity cannot be nil'
344
+ end
345
+
346
+ pattern = Regexp.new(/^\d+$/)
347
+ if unbillable_quantity !~ pattern
348
+ fail ArgumentError, "invalid value for \"unbillable_quantity\", must conform to the pattern #{pattern}."
349
+ end
350
+
351
+ @unbillable_quantity = unbillable_quantity
352
+ end
353
+
354
+ # Checks equality by comparing each attribute.
355
+ # @param [Object] Object to be compared
356
+ def ==(o)
357
+ return true if self.equal?(o)
358
+ self.class == o.class &&
359
+ coverage_started_at == o.coverage_started_at &&
360
+ incurred_amount == o.incurred_amount &&
361
+ posted_amount == o.posted_amount &&
362
+ posted_quantity == o.posted_quantity &&
363
+ quantity == o.quantity &&
364
+ state == o.state &&
365
+ unbillable_amount == o.unbillable_amount &&
366
+ unbillable_quantity == o.unbillable_quantity
367
+ end
368
+
369
+ # @see the `==` method
370
+ # @param [Object] Object to be compared
371
+ def eql?(o)
372
+ self == o
373
+ end
374
+
375
+ # Calculates hash code according to all attributes.
376
+ # @return [Integer] Hash code
377
+ def hash
378
+ [coverage_started_at, incurred_amount, posted_amount, posted_quantity, quantity, state, unbillable_amount, unbillable_quantity].hash
379
+ end
380
+
381
+ # Builds the object from hash
382
+ # @param [Hash] attributes Model attributes in the form of hash
383
+ # @return [Object] Returns the model itself
384
+ def self.build_from_hash(attributes)
385
+ return nil unless attributes.is_a?(Hash)
386
+ attributes = attributes.transform_keys(&:to_sym)
387
+ transformed_hash = {}
388
+ openapi_types.each_pair do |key, type|
389
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
390
+ transformed_hash["#{key}"] = nil
391
+ elsif type =~ /\AArray<(.*)>/i
392
+ # check to ensure the input is an array given that the attribute
393
+ # is documented as an array but the input is not
394
+ if attributes[attribute_map[key]].is_a?(Array)
395
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
396
+ end
397
+ elsif !attributes[attribute_map[key]].nil?
398
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
399
+ end
400
+ end
401
+ new(transformed_hash)
402
+ end
403
+
404
+ # Returns the object in the form of hash
405
+ # @return [Hash] Returns the object in the form of hash
406
+ def to_hash
407
+ hash = {}
408
+ self.class.attribute_map.each_pair do |attr, param|
409
+ value = self.send(attr)
410
+ if value.nil?
411
+ is_nullable = self.class.openapi_nullable.include?(attr)
412
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
413
+ end
414
+
415
+ hash[param] = _to_hash(value)
416
+ end
417
+ hash
418
+ end
419
+
420
+ end
421
+
422
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #Qubrics API
3
+
4
+ #Programmatic access to your Qubrics 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 Qubrics::Management::Generated
17
+ class MailboxCostUsageResponse < ApiModelBase
18
+ attr_accessor :meta
19
+
20
+ attr_accessor :ok
21
+
22
+ attr_accessor :data
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'meta' => :'meta',
28
+ :'ok' => :'ok',
29
+ :'data' => :'data'
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
+ :'meta' => :'ResponseMeta',
47
+ :'ok' => :'Boolean',
48
+ :'data' => :'MailboxCostUsage'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # List of class defined in allOf (OpenAPI v3)
59
+ def self.openapi_all_of
60
+ [
61
+ :'SuccessEnvelope'
62
+ ]
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Qubrics::Management::Generated::MailboxCostUsageResponse` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Qubrics::Management::Generated::MailboxCostUsageResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'meta')
82
+ self.meta = attributes[:'meta']
83
+ else
84
+ self.meta = nil
85
+ end
86
+
87
+ if attributes.key?(:'ok')
88
+ self.ok = attributes[:'ok']
89
+ else
90
+ self.ok = nil
91
+ end
92
+
93
+ if attributes.key?(:'data')
94
+ self.data = attributes[:'data']
95
+ else
96
+ self.data = nil
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
+ invalid_properties = Array.new
105
+ if @meta.nil?
106
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
107
+ end
108
+
109
+ if @ok.nil?
110
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
111
+ end
112
+
113
+ if @data.nil?
114
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @meta.nil?
125
+ return false if @ok.nil?
126
+ return false if @data.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] meta Value to be assigned
132
+ def meta=(meta)
133
+ if meta.nil?
134
+ fail ArgumentError, 'meta cannot be nil'
135
+ end
136
+
137
+ @meta = meta
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] ok Value to be assigned
142
+ def ok=(ok)
143
+ if ok.nil?
144
+ fail ArgumentError, 'ok cannot be nil'
145
+ end
146
+
147
+ @ok = ok
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] data Value to be assigned
152
+ def data=(data)
153
+ if data.nil?
154
+ fail ArgumentError, 'data cannot be nil'
155
+ end
156
+
157
+ @data = data
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ meta == o.meta &&
166
+ ok == o.ok &&
167
+ data == o.data
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [meta, ok, data].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ end
222
+
223
+ end