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