trustcomponent 0.0.1.beta.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/LICENSE.md +21 -0
- data/README.md +78 -0
- data/lib/trustcomponent/captcha.rb +24 -0
- data/lib/trustcomponent/client.rb +44 -0
- data/lib/trustcomponent/errors.rb +58 -0
- data/lib/trustcomponent/http_middleware.rb +83 -0
- data/lib/trustcomponent.rb +15 -0
- data/lib/trustcomponent_generated/api/analytics_server_events_api.rb +90 -0
- data/lib/trustcomponent_generated/api/analytics_websites_api.rb +527 -0
- data/lib/trustcomponent_generated/api/captcha_verifications_api.rb +88 -0
- data/lib/trustcomponent_generated/api/monitoring_heartbeats_api.rb +89 -0
- data/lib/trustcomponent_generated/api/platform_events_api.rb +106 -0
- data/lib/trustcomponent_generated/api/tax_validation_schedules_api.rb +147 -0
- data/lib/trustcomponent_generated/api/tax_validation_validation_results_api.rb +83 -0
- data/lib/trustcomponent_generated/api/tax_validation_validations_api.rb +156 -0
- data/lib/trustcomponent_generated/api_client.rb +441 -0
- data/lib/trustcomponent_generated/api_error.rb +58 -0
- data/lib/trustcomponent_generated/api_model_base.rb +88 -0
- data/lib/trustcomponent_generated/configuration.rb +400 -0
- data/lib/trustcomponent_generated/models/analytics_event_category_enum.rb +52 -0
- data/lib/trustcomponent_generated/models/analytics_realtime.rb +251 -0
- data/lib/trustcomponent_generated/models/analytics_realtime_page.rb +193 -0
- data/lib/trustcomponent_generated/models/analytics_realtime_point.rb +193 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_create_params.rb +295 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_create_params.rb +366 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_product_create_params.rb +298 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_create_params.rb +508 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_error_create_params.rb +269 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_refund_create_params.rb +211 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_result.rb +194 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_drop_reason_enum.rb +52 -0
- data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_dropped.rb +213 -0
- data/lib/trustcomponent_generated/models/analytics_stats_breakdown.rb +351 -0
- data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row.rb +201 -0
- data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row_page.rb +226 -0
- data/lib/trustcomponent_generated/models/analytics_stats_conversions.rb +249 -0
- data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal.rb +260 -0
- data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal_revenue.rb +193 -0
- data/lib/trustcomponent_generated/models/analytics_stats_dimension_enum.rb +69 -0
- data/lib/trustcomponent_generated/models/analytics_stats_filter_match_mode_enum.rb +40 -0
- data/lib/trustcomponent_generated/models/analytics_stats_filter_operator_enum.rb +45 -0
- data/lib/trustcomponent_generated/models/analytics_stats_granularity_enum.rb +40 -0
- data/lib/trustcomponent_generated/models/analytics_stats_overview.rb +282 -0
- data/lib/trustcomponent_generated/models/analytics_stats_timeseries.rb +270 -0
- data/lib/trustcomponent_generated/models/analytics_stats_timeseries_point.rb +192 -0
- data/lib/trustcomponent_generated/models/analytics_stats_totals.rb +307 -0
- data/lib/trustcomponent_generated/models/analytics_website.rb +249 -0
- data/lib/trustcomponent_generated/models/analytics_websites_page.rb +249 -0
- data/lib/trustcomponent_generated/models/captcha_verification_result.rb +350 -0
- data/lib/trustcomponent_generated/models/platform_event.rb +439 -0
- data/lib/trustcomponent_generated/models/platform_event_actor.rb +218 -0
- data/lib/trustcomponent_generated/models/platform_event_actor_automation.rb +214 -0
- data/lib/trustcomponent_generated/models/platform_event_actor_automation_kind_enum.rb +41 -0
- data/lib/trustcomponent_generated/models/platform_event_actor_type_enum.rb +43 -0
- data/lib/trustcomponent_generated/models/platform_event_change.rb +263 -0
- data/lib/trustcomponent_generated/models/platform_event_change_operation_enum.rb +43 -0
- data/lib/trustcomponent_generated/models/platform_event_origin.rb +263 -0
- data/lib/trustcomponent_generated/models/platform_event_ref.rb +204 -0
- data/lib/trustcomponent_generated/models/platform_event_source_enum.rb +44 -0
- data/lib/trustcomponent_generated/models/platform_events_page.rb +314 -0
- data/lib/trustcomponent_generated/models/tax_validation_match_status_enum.rb +44 -0
- data/lib/trustcomponent_generated/models/tax_validation_provider_enum.rb +46 -0
- data/lib/trustcomponent_generated/models/tax_validation_provider_status_enum.rb +51 -0
- data/lib/trustcomponent_generated/models/tax_validation_schedule.rb +423 -0
- data/lib/trustcomponent_generated/models/tax_validation_schedule_create_params.rb +321 -0
- data/lib/trustcomponent_generated/models/tax_validation_tax_address.rb +188 -0
- data/lib/trustcomponent_generated/models/tax_validation_tax_identifier_scheme_enum.rb +49 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation.rb +372 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_address_match.rb +290 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_batch_create_params.rb +176 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_create_params.rb +292 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_frequency_enum.rb +41 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_input.rb +322 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_match.rb +238 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_mode_enum.rb +40 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_outcome_enum.rb +44 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_request_status_enum.rb +44 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_response_data.rb +177 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_result.rb +459 -0
- data/lib/trustcomponent_generated/models/tax_validation_validation_schedule_attach_params.rb +225 -0
- data/lib/trustcomponent_generated/models/tax_validation_verification_method_enum.rb +40 -0
- data/lib/trustcomponent_generated/modules.rb +51 -0
- data/lib/trustcomponent_generated/version.rb +15 -0
- data/lib/trustcomponent_generated.rb +110 -0
- metadata +190 -0
data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_drop_reason_enum.rb
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TrustComponent API
|
|
3
|
+
|
|
4
|
+
#The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.0.1-beta.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TrustComponent::Generated
|
|
17
|
+
class AnalyticsServerEventBatchResultDropReasonEnum
|
|
18
|
+
HOSTNAME = "HOSTNAME".freeze
|
|
19
|
+
MALFORMED = "MALFORMED".freeze
|
|
20
|
+
STALE = "STALE".freeze
|
|
21
|
+
BOT = "BOT".freeze
|
|
22
|
+
PRIVACY_SIGNAL = "PRIVACY_SIGNAL".freeze
|
|
23
|
+
CONSENT = "CONSENT".freeze
|
|
24
|
+
PLAN = "PLAN".freeze
|
|
25
|
+
RULE = "RULE".freeze
|
|
26
|
+
DUPLICATE = "DUPLICATE".freeze
|
|
27
|
+
DUPLICATE_ORDER = "DUPLICATE_ORDER".freeze
|
|
28
|
+
ORDER_CONFIRMED = "ORDER_CONFIRMED".freeze
|
|
29
|
+
UNKNOWN_ORDER = "UNKNOWN_ORDER".freeze
|
|
30
|
+
BROWSER_ONLY = "BROWSER_ONLY".freeze
|
|
31
|
+
ERASED = "ERASED".freeze
|
|
32
|
+
|
|
33
|
+
def self.all_vars
|
|
34
|
+
@all_vars ||= [HOSTNAME, MALFORMED, STALE, BOT, PRIVACY_SIGNAL, CONSENT, PLAN, RULE, DUPLICATE, DUPLICATE_ORDER, ORDER_CONFIRMED, UNKNOWN_ORDER, BROWSER_ONLY, ERASED].freeze
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Builds the enum from string
|
|
38
|
+
# @param [String] The enum value in the form of the string
|
|
39
|
+
# @return [String] The enum value
|
|
40
|
+
def self.build_from_hash(value)
|
|
41
|
+
new.build_from_hash(value)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Builds the enum from string
|
|
45
|
+
# @param [String] The enum value in the form of the string
|
|
46
|
+
# @return [String] The enum value
|
|
47
|
+
def build_from_hash(value)
|
|
48
|
+
return value if AnalyticsServerEventBatchResultDropReasonEnum.all_vars.include?(value)
|
|
49
|
+
raise "Invalid ENUM value #{value} for class #AnalyticsServerEventBatchResultDropReasonEnum"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TrustComponent API
|
|
3
|
+
|
|
4
|
+
#The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.0.1-beta.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TrustComponent::Generated
|
|
17
|
+
class AnalyticsServerEventBatchResultDropped < ApiModelBase
|
|
18
|
+
attr_accessor :reason
|
|
19
|
+
|
|
20
|
+
# Number of events dropped for this reason
|
|
21
|
+
attr_accessor :count
|
|
22
|
+
|
|
23
|
+
class EnumAttributeValidator
|
|
24
|
+
attr_reader :datatype
|
|
25
|
+
attr_reader :allowable_values
|
|
26
|
+
|
|
27
|
+
def initialize(datatype, allowable_values)
|
|
28
|
+
@allowable_values = allowable_values.map do |value|
|
|
29
|
+
case datatype.to_s
|
|
30
|
+
when /Integer/i
|
|
31
|
+
value.to_i
|
|
32
|
+
when /Float/i
|
|
33
|
+
value.to_f
|
|
34
|
+
else
|
|
35
|
+
value
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def valid?(value)
|
|
41
|
+
!value || allowable_values.include?(value)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'reason' => :'reason',
|
|
49
|
+
:'count' => :'count'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns attribute mapping this model knows about
|
|
54
|
+
def self.acceptable_attribute_map
|
|
55
|
+
attribute_map
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns all the JSON keys this model knows about
|
|
59
|
+
def self.acceptable_attributes
|
|
60
|
+
acceptable_attribute_map.values
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute type mapping.
|
|
64
|
+
def self.openapi_types
|
|
65
|
+
{
|
|
66
|
+
:'reason' => :'AnalyticsServerEventBatchResultDropReasonEnum',
|
|
67
|
+
:'count' => :'Integer'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List of attributes with nullable: true
|
|
72
|
+
def self.openapi_nullable
|
|
73
|
+
Set.new([
|
|
74
|
+
])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes the object
|
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
79
|
+
def initialize(attributes = {})
|
|
80
|
+
if (!attributes.is_a?(Hash))
|
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::AnalyticsServerEventBatchResultDropped` initialize method"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::AnalyticsServerEventBatchResultDropped`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
|
+
end
|
|
90
|
+
h[k.to_sym] = v
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'reason')
|
|
94
|
+
self.reason = attributes[:'reason']
|
|
95
|
+
else
|
|
96
|
+
self.reason = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'count')
|
|
100
|
+
self.count = attributes[:'count']
|
|
101
|
+
else
|
|
102
|
+
self.count = nil
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
107
|
+
# @return Array for valid properties with the reasons
|
|
108
|
+
def list_invalid_properties
|
|
109
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
110
|
+
invalid_properties = Array.new
|
|
111
|
+
if @reason.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "reason", reason cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @count.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
invalid_properties
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Check to see if the all the properties in the model are valid
|
|
123
|
+
# @return true if the model is valid
|
|
124
|
+
def valid?
|
|
125
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
|
+
return false if @reason.nil?
|
|
127
|
+
return false if @count.nil?
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] reason Value to be assigned
|
|
133
|
+
def reason=(reason)
|
|
134
|
+
if reason.nil?
|
|
135
|
+
fail ArgumentError, 'reason cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@reason = reason
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] count Value to be assigned
|
|
143
|
+
def count=(count)
|
|
144
|
+
if count.nil?
|
|
145
|
+
fail ArgumentError, 'count cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@count = count
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Checks equality by comparing each attribute.
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def ==(o)
|
|
154
|
+
return true if self.equal?(o)
|
|
155
|
+
self.class == o.class &&
|
|
156
|
+
reason == o.reason &&
|
|
157
|
+
count == o.count
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# @see the `==` method
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def eql?(o)
|
|
163
|
+
self == o
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Calculates hash code according to all attributes.
|
|
167
|
+
# @return [Integer] Hash code
|
|
168
|
+
def hash
|
|
169
|
+
[reason, count].hash
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Builds the object from hash
|
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
174
|
+
# @return [Object] Returns the model itself
|
|
175
|
+
def self.build_from_hash(attributes)
|
|
176
|
+
return nil unless attributes.is_a?(Hash)
|
|
177
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
178
|
+
transformed_hash = {}
|
|
179
|
+
openapi_types.each_pair do |key, type|
|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
181
|
+
transformed_hash["#{key}"] = nil
|
|
182
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
183
|
+
# check to ensure the input is an array given that the attribute
|
|
184
|
+
# is documented as an array but the input is not
|
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
187
|
+
end
|
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
new(transformed_hash)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns the object in the form of hash
|
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
|
197
|
+
def to_hash
|
|
198
|
+
hash = {}
|
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
200
|
+
value = self.send(attr)
|
|
201
|
+
if value.nil?
|
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
hash[param] = _to_hash(value)
|
|
207
|
+
end
|
|
208
|
+
hash
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TrustComponent API
|
|
3
|
+
|
|
4
|
+
#The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.0.1-beta.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.24.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TrustComponent::Generated
|
|
17
|
+
# Key figures split by one dimension
|
|
18
|
+
class AnalyticsStatsBreakdown < ApiModelBase
|
|
19
|
+
# Start of the range that was used
|
|
20
|
+
attr_accessor :from
|
|
21
|
+
|
|
22
|
+
# End of the range that was used
|
|
23
|
+
attr_accessor :to
|
|
24
|
+
|
|
25
|
+
attr_accessor :dimension
|
|
26
|
+
|
|
27
|
+
# One row per value of the dimension, largest first
|
|
28
|
+
attr_accessor :rows
|
|
29
|
+
|
|
30
|
+
# Zero-based page index
|
|
31
|
+
attr_accessor :page
|
|
32
|
+
|
|
33
|
+
# Number of rows per page
|
|
34
|
+
attr_accessor :page_size
|
|
35
|
+
|
|
36
|
+
# Number of values of the dimension in the range
|
|
37
|
+
attr_accessor :total_elements
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
62
|
+
def self.attribute_map
|
|
63
|
+
{
|
|
64
|
+
:'from' => :'from',
|
|
65
|
+
:'to' => :'to',
|
|
66
|
+
:'dimension' => :'dimension',
|
|
67
|
+
:'rows' => :'rows',
|
|
68
|
+
:'page' => :'page',
|
|
69
|
+
:'page_size' => :'pageSize',
|
|
70
|
+
:'total_elements' => :'totalElements'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns attribute mapping this model knows about
|
|
75
|
+
def self.acceptable_attribute_map
|
|
76
|
+
attribute_map
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
|
80
|
+
def self.acceptable_attributes
|
|
81
|
+
acceptable_attribute_map.values
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Attribute type mapping.
|
|
85
|
+
def self.openapi_types
|
|
86
|
+
{
|
|
87
|
+
:'from' => :'String',
|
|
88
|
+
:'to' => :'String',
|
|
89
|
+
:'dimension' => :'AnalyticsStatsDimensionEnum',
|
|
90
|
+
:'rows' => :'Array<AnalyticsStatsBreakdownRow>',
|
|
91
|
+
:'page' => :'Integer',
|
|
92
|
+
:'page_size' => :'Integer',
|
|
93
|
+
:'total_elements' => :'Integer'
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# List of attributes with nullable: true
|
|
98
|
+
def self.openapi_nullable
|
|
99
|
+
Set.new([
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Initializes the object
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
def initialize(attributes = {})
|
|
106
|
+
if (!attributes.is_a?(Hash))
|
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::AnalyticsStatsBreakdown` initialize method"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::AnalyticsStatsBreakdown`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
115
|
+
end
|
|
116
|
+
h[k.to_sym] = v
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'from')
|
|
120
|
+
self.from = attributes[:'from']
|
|
121
|
+
else
|
|
122
|
+
self.from = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'to')
|
|
126
|
+
self.to = attributes[:'to']
|
|
127
|
+
else
|
|
128
|
+
self.to = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'dimension')
|
|
132
|
+
self.dimension = attributes[:'dimension']
|
|
133
|
+
else
|
|
134
|
+
self.dimension = nil
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'rows')
|
|
138
|
+
if (value = attributes[:'rows']).is_a?(Array)
|
|
139
|
+
self.rows = value
|
|
140
|
+
end
|
|
141
|
+
else
|
|
142
|
+
self.rows = nil
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'page')
|
|
146
|
+
self.page = attributes[:'page']
|
|
147
|
+
else
|
|
148
|
+
self.page = nil
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'page_size')
|
|
152
|
+
self.page_size = attributes[:'page_size']
|
|
153
|
+
else
|
|
154
|
+
self.page_size = nil
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'total_elements')
|
|
158
|
+
self.total_elements = attributes[:'total_elements']
|
|
159
|
+
else
|
|
160
|
+
self.total_elements = nil
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
165
|
+
# @return Array for valid properties with the reasons
|
|
166
|
+
def list_invalid_properties
|
|
167
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
168
|
+
invalid_properties = Array.new
|
|
169
|
+
if @from.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if @to.nil?
|
|
174
|
+
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if @dimension.nil?
|
|
178
|
+
invalid_properties.push('invalid value for "dimension", dimension cannot be nil.')
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if @rows.nil?
|
|
182
|
+
invalid_properties.push('invalid value for "rows", rows cannot be nil.')
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if @page.nil?
|
|
186
|
+
invalid_properties.push('invalid value for "page", page cannot be nil.')
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if @page_size.nil?
|
|
190
|
+
invalid_properties.push('invalid value for "page_size", page_size cannot be nil.')
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if @total_elements.nil?
|
|
194
|
+
invalid_properties.push('invalid value for "total_elements", total_elements cannot be nil.')
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
invalid_properties
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Check to see if the all the properties in the model are valid
|
|
201
|
+
# @return true if the model is valid
|
|
202
|
+
def valid?
|
|
203
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
204
|
+
return false if @from.nil?
|
|
205
|
+
return false if @to.nil?
|
|
206
|
+
return false if @dimension.nil?
|
|
207
|
+
return false if @rows.nil?
|
|
208
|
+
return false if @page.nil?
|
|
209
|
+
return false if @page_size.nil?
|
|
210
|
+
return false if @total_elements.nil?
|
|
211
|
+
true
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] from Value to be assigned
|
|
216
|
+
def from=(from)
|
|
217
|
+
if from.nil?
|
|
218
|
+
fail ArgumentError, 'from cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@from = from
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] to Value to be assigned
|
|
226
|
+
def to=(to)
|
|
227
|
+
if to.nil?
|
|
228
|
+
fail ArgumentError, 'to cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@to = to
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Custom attribute writer method with validation
|
|
235
|
+
# @param [Object] dimension Value to be assigned
|
|
236
|
+
def dimension=(dimension)
|
|
237
|
+
if dimension.nil?
|
|
238
|
+
fail ArgumentError, 'dimension cannot be nil'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@dimension = dimension
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Custom attribute writer method with validation
|
|
245
|
+
# @param [Object] rows Value to be assigned
|
|
246
|
+
def rows=(rows)
|
|
247
|
+
if rows.nil?
|
|
248
|
+
fail ArgumentError, 'rows cannot be nil'
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
@rows = rows
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Custom attribute writer method with validation
|
|
255
|
+
# @param [Object] page Value to be assigned
|
|
256
|
+
def page=(page)
|
|
257
|
+
if page.nil?
|
|
258
|
+
fail ArgumentError, 'page cannot be nil'
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
@page = page
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Custom attribute writer method with validation
|
|
265
|
+
# @param [Object] page_size Value to be assigned
|
|
266
|
+
def page_size=(page_size)
|
|
267
|
+
if page_size.nil?
|
|
268
|
+
fail ArgumentError, 'page_size cannot be nil'
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
@page_size = page_size
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Custom attribute writer method with validation
|
|
275
|
+
# @param [Object] total_elements Value to be assigned
|
|
276
|
+
def total_elements=(total_elements)
|
|
277
|
+
if total_elements.nil?
|
|
278
|
+
fail ArgumentError, 'total_elements cannot be nil'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
@total_elements = total_elements
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Checks equality by comparing each attribute.
|
|
285
|
+
# @param [Object] Object to be compared
|
|
286
|
+
def ==(o)
|
|
287
|
+
return true if self.equal?(o)
|
|
288
|
+
self.class == o.class &&
|
|
289
|
+
from == o.from &&
|
|
290
|
+
to == o.to &&
|
|
291
|
+
dimension == o.dimension &&
|
|
292
|
+
rows == o.rows &&
|
|
293
|
+
page == o.page &&
|
|
294
|
+
page_size == o.page_size &&
|
|
295
|
+
total_elements == o.total_elements
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# @see the `==` method
|
|
299
|
+
# @param [Object] Object to be compared
|
|
300
|
+
def eql?(o)
|
|
301
|
+
self == o
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Calculates hash code according to all attributes.
|
|
305
|
+
# @return [Integer] Hash code
|
|
306
|
+
def hash
|
|
307
|
+
[from, to, dimension, rows, page, page_size, total_elements].hash
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
# Builds the object from hash
|
|
311
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
312
|
+
# @return [Object] Returns the model itself
|
|
313
|
+
def self.build_from_hash(attributes)
|
|
314
|
+
return nil unless attributes.is_a?(Hash)
|
|
315
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
316
|
+
transformed_hash = {}
|
|
317
|
+
openapi_types.each_pair do |key, type|
|
|
318
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
319
|
+
transformed_hash["#{key}"] = nil
|
|
320
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
321
|
+
# check to ensure the input is an array given that the attribute
|
|
322
|
+
# is documented as an array but the input is not
|
|
323
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
324
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
325
|
+
end
|
|
326
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
327
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
328
|
+
end
|
|
329
|
+
end
|
|
330
|
+
new(transformed_hash)
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Returns the object in the form of hash
|
|
334
|
+
# @return [Hash] Returns the object in the form of hash
|
|
335
|
+
def to_hash
|
|
336
|
+
hash = {}
|
|
337
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
338
|
+
value = self.send(attr)
|
|
339
|
+
if value.nil?
|
|
340
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
341
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
hash[param] = _to_hash(value)
|
|
345
|
+
end
|
|
346
|
+
hash
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
end
|