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