plainrouter-sdk 0.1.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 +202 -0
- data/README.md +59 -0
- data/lib/plainrouter/client.rb +44 -0
- data/lib/plainrouter/openapi/api/event_api.rb +213 -0
- data/lib/plainrouter/openapi/api/operations_api.rb +542 -0
- data/lib/plainrouter/openapi/api/sandbox_api.rb +272 -0
- data/lib/plainrouter/openapi/api_client.rb +441 -0
- data/lib/plainrouter/openapi/api_error.rb +58 -0
- data/lib/plainrouter/openapi/api_model_base.rb +88 -0
- data/lib/plainrouter/openapi/configuration.rb +399 -0
- data/lib/plainrouter/openapi/models/create_event200_response.rb +190 -0
- data/lib/plainrouter/openapi/models/create_event_request.rb +103 -0
- data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +344 -0
- data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +346 -0
- data/lib/plainrouter/openapi/models/create_event_request_any_of_event_time.rb +104 -0
- data/lib/plainrouter/openapi/models/create_event_request_any_of_value_data.rb +186 -0
- data/lib/plainrouter/openapi/models/create_sandbox_key201_response.rb +320 -0
- data/lib/plainrouter/openapi/models/create_sandbox_key201_response_use.rb +216 -0
- data/lib/plainrouter/openapi/models/delete_user_data200_response.rb +268 -0
- data/lib/plainrouter/openapi/models/delete_user_data_request.rb +225 -0
- data/lib/plainrouter/openapi/models/delivery_status.rb +49 -0
- data/lib/plainrouter/openapi/models/destination.rb +354 -0
- data/lib/plainrouter/openapi/models/destination_credential_source.rb +40 -0
- data/lib/plainrouter/openapi/models/destination_status.rb +40 -0
- data/lib/plainrouter/openapi/models/destination_type.rb +39 -0
- data/lib/plainrouter/openapi/models/emq_snapshot.rb +344 -0
- data/lib/plainrouter/openapi/models/error_message.rb +164 -0
- data/lib/plainrouter/openapi/models/event.rb +782 -0
- data/lib/plainrouter/openapi/models/get_emq_report200_response.rb +166 -0
- data/lib/plainrouter/openapi/models/get_emq_report200_response_snapshots_inner.rb +342 -0
- data/lib/plainrouter/openapi/models/get_event200_response.rb +218 -0
- data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +440 -0
- data/lib/plainrouter/openapi/models/get_event200_response_event.rb +624 -0
- data/lib/plainrouter/openapi/models/get_event200_response_event_consent.rb +103 -0
- data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +414 -0
- data/lib/plainrouter/openapi/models/get_event200_response_lineage.rb +178 -0
- data/lib/plainrouter/openapi/models/get_event200_response_lineage_children_inner.rb +596 -0
- data/lib/plainrouter/openapi/models/get_event200_response_lineage_parent.rb +596 -0
- data/lib/plainrouter/openapi/models/get_reconciliation_report200_response.rb +192 -0
- data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner.rb +476 -0
- data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_buckets_value.rb +216 -0
- data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts.rb +190 -0
- data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts_accepted.rb +103 -0
- data/lib/plainrouter/openapi/models/get_sandbox200_response.rb +372 -0
- data/lib/plainrouter/openapi/models/get_sandbox200_response_self_serve_key.rb +242 -0
- data/lib/plainrouter/openapi/models/get_sandbox200_response_try.rb +242 -0
- data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body.rb +242 -0
- data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body_value_data.rb +216 -0
- data/lib/plainrouter/openapi/models/jurisdiction_policy_class.rb +40 -0
- data/lib/plainrouter/openapi/models/list_events200_response.rb +190 -0
- data/lib/plainrouter/openapi/models/list_events200_response_events.rb +382 -0
- data/lib/plainrouter/openapi/models/list_events200_response_events_links_inner.rb +202 -0
- data/lib/plainrouter/openapi/models/list_events200_response_metrics.rb +228 -0
- data/lib/plainrouter/openapi/models/list_events_by_cursor200_response.rb +190 -0
- data/lib/plainrouter/openapi/models/list_events_by_cursor200_response_events.rb +252 -0
- data/lib/plainrouter/openapi/models/reconciliation_report.rb +464 -0
- data/lib/plainrouter/openapi/models/replay_deliveries202_response.rb +242 -0
- data/lib/plainrouter/openapi/models/replay_deliveries_request.rb +199 -0
- data/lib/plainrouter/openapi/models/send_test_purchase200_response.rb +224 -0
- data/lib/plainrouter/openapi/models/send_test_purchase422_response.rb +103 -0
- data/lib/plainrouter/openapi/models/send_test_purchase_request.rb +224 -0
- data/lib/plainrouter/openapi/models/set_destination_test_mode200_response.rb +190 -0
- data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +338 -0
- data/lib/plainrouter/openapi/models/set_destination_test_mode_request.rb +189 -0
- data/lib/plainrouter/openapi/models/traffic_class.rb +40 -0
- data/lib/plainrouter/openapi/models/validate_sandbox_event200_response.rb +320 -0
- data/lib/plainrouter/openapi/models/validate_sandbox_event_request.rb +194 -0
- data/lib/plainrouter/openapi/models/validate_sandbox_event_request_value_data.rb +166 -0
- data/lib/plainrouter/openapi/models/validation_error.rb +192 -0
- data/lib/plainrouter/openapi/version.rb +15 -0
- data/lib/plainrouter/openapi.rb +102 -0
- data/lib/plainrouter/version.rb +6 -0
- data/lib/plainrouter.rb +10 -0
- metadata +176 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PlainRouter Conversion API
|
|
3
|
+
|
|
4
|
+
#PlainRouter public Signals Conversion API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PlainRouter::OpenAPI
|
|
17
|
+
class JurisdictionPolicyClass
|
|
18
|
+
STRICT_EU = "strict_eu".freeze
|
|
19
|
+
GLOBAL = "global".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [STRICT_EU, GLOBAL].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if JurisdictionPolicyClass.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #JurisdictionPolicyClass"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PlainRouter Conversion API
|
|
3
|
+
|
|
4
|
+
#PlainRouter public Signals Conversion API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PlainRouter::OpenAPI
|
|
17
|
+
class ListEvents200Response < ApiModelBase
|
|
18
|
+
attr_accessor :events
|
|
19
|
+
|
|
20
|
+
attr_accessor :metrics
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'events' => :'events',
|
|
26
|
+
:'metrics' => :'metrics'
|
|
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
|
+
:'events' => :'ListEvents200ResponseEvents',
|
|
44
|
+
:'metrics' => :'ListEvents200ResponseMetrics'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ListEvents200Response` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ListEvents200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'events')
|
|
71
|
+
self.events = attributes[:'events']
|
|
72
|
+
else
|
|
73
|
+
self.events = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'metrics')
|
|
77
|
+
self.metrics = attributes[:'metrics']
|
|
78
|
+
else
|
|
79
|
+
self.metrics = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @events.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "events", events cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @metrics.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "metrics", metrics cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @events.nil?
|
|
104
|
+
return false if @metrics.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] events Value to be assigned
|
|
110
|
+
def events=(events)
|
|
111
|
+
if events.nil?
|
|
112
|
+
fail ArgumentError, 'events cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@events = events
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] metrics Value to be assigned
|
|
120
|
+
def metrics=(metrics)
|
|
121
|
+
if metrics.nil?
|
|
122
|
+
fail ArgumentError, 'metrics cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@metrics = metrics
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
events == o.events &&
|
|
134
|
+
metrics == o.metrics
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[events, metrics].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PlainRouter Conversion API
|
|
3
|
+
|
|
4
|
+
#PlainRouter public Signals Conversion API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.5.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PlainRouter::OpenAPI
|
|
17
|
+
class ListEvents200ResponseEvents < ApiModelBase
|
|
18
|
+
attr_accessor :current_page
|
|
19
|
+
|
|
20
|
+
attr_accessor :data
|
|
21
|
+
|
|
22
|
+
attr_accessor :first_page_url
|
|
23
|
+
|
|
24
|
+
attr_accessor :from
|
|
25
|
+
|
|
26
|
+
attr_accessor :last_page
|
|
27
|
+
|
|
28
|
+
attr_accessor :last_page_url
|
|
29
|
+
|
|
30
|
+
attr_accessor :links
|
|
31
|
+
|
|
32
|
+
attr_accessor :next_page_url
|
|
33
|
+
|
|
34
|
+
attr_accessor :path
|
|
35
|
+
|
|
36
|
+
attr_accessor :per_page
|
|
37
|
+
|
|
38
|
+
attr_accessor :prev_page_url
|
|
39
|
+
|
|
40
|
+
attr_accessor :to
|
|
41
|
+
|
|
42
|
+
attr_accessor :total
|
|
43
|
+
|
|
44
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
45
|
+
def self.attribute_map
|
|
46
|
+
{
|
|
47
|
+
:'current_page' => :'current_page',
|
|
48
|
+
:'data' => :'data',
|
|
49
|
+
:'first_page_url' => :'first_page_url',
|
|
50
|
+
:'from' => :'from',
|
|
51
|
+
:'last_page' => :'last_page',
|
|
52
|
+
:'last_page_url' => :'last_page_url',
|
|
53
|
+
:'links' => :'links',
|
|
54
|
+
:'next_page_url' => :'next_page_url',
|
|
55
|
+
:'path' => :'path',
|
|
56
|
+
:'per_page' => :'per_page',
|
|
57
|
+
:'prev_page_url' => :'prev_page_url',
|
|
58
|
+
:'to' => :'to',
|
|
59
|
+
:'total' => :'total'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns attribute mapping this model knows about
|
|
64
|
+
def self.acceptable_attribute_map
|
|
65
|
+
attribute_map
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
acceptable_attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'current_page' => :'Integer',
|
|
77
|
+
:'data' => :'Array<GetEvent200ResponseEvent>',
|
|
78
|
+
:'first_page_url' => :'String',
|
|
79
|
+
:'from' => :'Integer',
|
|
80
|
+
:'last_page' => :'Integer',
|
|
81
|
+
:'last_page_url' => :'String',
|
|
82
|
+
:'links' => :'Array<ListEvents200ResponseEventsLinksInner>',
|
|
83
|
+
:'next_page_url' => :'String',
|
|
84
|
+
:'path' => :'String',
|
|
85
|
+
:'per_page' => :'Integer',
|
|
86
|
+
:'prev_page_url' => :'String',
|
|
87
|
+
:'to' => :'Integer',
|
|
88
|
+
:'total' => :'Integer'
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# List of attributes with nullable: true
|
|
93
|
+
def self.openapi_nullable
|
|
94
|
+
Set.new([
|
|
95
|
+
:'first_page_url',
|
|
96
|
+
:'from',
|
|
97
|
+
:'last_page_url',
|
|
98
|
+
:'next_page_url',
|
|
99
|
+
:'path',
|
|
100
|
+
:'prev_page_url',
|
|
101
|
+
:'to',
|
|
102
|
+
])
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Initializes the object
|
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
107
|
+
def initialize(attributes = {})
|
|
108
|
+
if (!attributes.is_a?(Hash))
|
|
109
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ListEvents200ResponseEvents` initialize method"
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
113
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
114
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
115
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
116
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ListEvents200ResponseEvents`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
117
|
+
end
|
|
118
|
+
h[k.to_sym] = v
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'current_page')
|
|
122
|
+
self.current_page = attributes[:'current_page']
|
|
123
|
+
else
|
|
124
|
+
self.current_page = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'data')
|
|
128
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
129
|
+
self.data = value
|
|
130
|
+
end
|
|
131
|
+
else
|
|
132
|
+
self.data = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'first_page_url')
|
|
136
|
+
self.first_page_url = attributes[:'first_page_url']
|
|
137
|
+
else
|
|
138
|
+
self.first_page_url = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'from')
|
|
142
|
+
self.from = attributes[:'from']
|
|
143
|
+
else
|
|
144
|
+
self.from = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'last_page')
|
|
148
|
+
self.last_page = attributes[:'last_page']
|
|
149
|
+
else
|
|
150
|
+
self.last_page = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'last_page_url')
|
|
154
|
+
self.last_page_url = attributes[:'last_page_url']
|
|
155
|
+
else
|
|
156
|
+
self.last_page_url = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'links')
|
|
160
|
+
if (value = attributes[:'links']).is_a?(Array)
|
|
161
|
+
self.links = value
|
|
162
|
+
end
|
|
163
|
+
else
|
|
164
|
+
self.links = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'next_page_url')
|
|
168
|
+
self.next_page_url = attributes[:'next_page_url']
|
|
169
|
+
else
|
|
170
|
+
self.next_page_url = nil
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'path')
|
|
174
|
+
self.path = attributes[:'path']
|
|
175
|
+
else
|
|
176
|
+
self.path = nil
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'per_page')
|
|
180
|
+
self.per_page = attributes[:'per_page']
|
|
181
|
+
else
|
|
182
|
+
self.per_page = nil
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'prev_page_url')
|
|
186
|
+
self.prev_page_url = attributes[:'prev_page_url']
|
|
187
|
+
else
|
|
188
|
+
self.prev_page_url = nil
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'to')
|
|
192
|
+
self.to = attributes[:'to']
|
|
193
|
+
else
|
|
194
|
+
self.to = nil
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'total')
|
|
198
|
+
self.total = attributes[:'total']
|
|
199
|
+
else
|
|
200
|
+
self.total = nil
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
205
|
+
# @return Array for valid properties with the reasons
|
|
206
|
+
def list_invalid_properties
|
|
207
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
208
|
+
invalid_properties = Array.new
|
|
209
|
+
if @current_page.nil?
|
|
210
|
+
invalid_properties.push('invalid value for "current_page", current_page cannot be nil.')
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if @data.nil?
|
|
214
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if @last_page.nil?
|
|
218
|
+
invalid_properties.push('invalid value for "last_page", last_page cannot be nil.')
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if @links.nil?
|
|
222
|
+
invalid_properties.push('invalid value for "links", links cannot be nil.')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if @per_page.nil?
|
|
226
|
+
invalid_properties.push('invalid value for "per_page", per_page cannot be nil.')
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if @total.nil?
|
|
230
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
invalid_properties
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Check to see if the all the properties in the model are valid
|
|
237
|
+
# @return true if the model is valid
|
|
238
|
+
def valid?
|
|
239
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
240
|
+
return false if @current_page.nil?
|
|
241
|
+
return false if @data.nil?
|
|
242
|
+
return false if @last_page.nil?
|
|
243
|
+
return false if @links.nil?
|
|
244
|
+
return false if @per_page.nil?
|
|
245
|
+
return false if @total.nil?
|
|
246
|
+
true
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Custom attribute writer method with validation
|
|
250
|
+
# @param [Object] current_page Value to be assigned
|
|
251
|
+
def current_page=(current_page)
|
|
252
|
+
if current_page.nil?
|
|
253
|
+
fail ArgumentError, 'current_page cannot be nil'
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
@current_page = current_page
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Custom attribute writer method with validation
|
|
260
|
+
# @param [Object] data Value to be assigned
|
|
261
|
+
def data=(data)
|
|
262
|
+
if data.nil?
|
|
263
|
+
fail ArgumentError, 'data cannot be nil'
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
@data = data
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Custom attribute writer method with validation
|
|
270
|
+
# @param [Object] last_page Value to be assigned
|
|
271
|
+
def last_page=(last_page)
|
|
272
|
+
if last_page.nil?
|
|
273
|
+
fail ArgumentError, 'last_page cannot be nil'
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
@last_page = last_page
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Custom attribute writer method with validation
|
|
280
|
+
# @param [Object] links Value to be assigned
|
|
281
|
+
def links=(links)
|
|
282
|
+
if links.nil?
|
|
283
|
+
fail ArgumentError, 'links cannot be nil'
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
@links = links
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Custom attribute writer method with validation
|
|
290
|
+
# @param [Object] per_page Value to be assigned
|
|
291
|
+
def per_page=(per_page)
|
|
292
|
+
if per_page.nil?
|
|
293
|
+
fail ArgumentError, 'per_page cannot be nil'
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
@per_page = per_page
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Custom attribute writer method with validation
|
|
300
|
+
# @param [Object] total Value to be assigned
|
|
301
|
+
def total=(total)
|
|
302
|
+
if total.nil?
|
|
303
|
+
fail ArgumentError, 'total cannot be nil'
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
@total = total
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Checks equality by comparing each attribute.
|
|
310
|
+
# @param [Object] Object to be compared
|
|
311
|
+
def ==(o)
|
|
312
|
+
return true if self.equal?(o)
|
|
313
|
+
self.class == o.class &&
|
|
314
|
+
current_page == o.current_page &&
|
|
315
|
+
data == o.data &&
|
|
316
|
+
first_page_url == o.first_page_url &&
|
|
317
|
+
from == o.from &&
|
|
318
|
+
last_page == o.last_page &&
|
|
319
|
+
last_page_url == o.last_page_url &&
|
|
320
|
+
links == o.links &&
|
|
321
|
+
next_page_url == o.next_page_url &&
|
|
322
|
+
path == o.path &&
|
|
323
|
+
per_page == o.per_page &&
|
|
324
|
+
prev_page_url == o.prev_page_url &&
|
|
325
|
+
to == o.to &&
|
|
326
|
+
total == o.total
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# @see the `==` method
|
|
330
|
+
# @param [Object] Object to be compared
|
|
331
|
+
def eql?(o)
|
|
332
|
+
self == o
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# Calculates hash code according to all attributes.
|
|
336
|
+
# @return [Integer] Hash code
|
|
337
|
+
def hash
|
|
338
|
+
[current_page, data, first_page_url, from, last_page, last_page_url, links, next_page_url, path, per_page, prev_page_url, to, total].hash
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Builds the object from hash
|
|
342
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
343
|
+
# @return [Object] Returns the model itself
|
|
344
|
+
def self.build_from_hash(attributes)
|
|
345
|
+
return nil unless attributes.is_a?(Hash)
|
|
346
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
347
|
+
transformed_hash = {}
|
|
348
|
+
openapi_types.each_pair do |key, type|
|
|
349
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
350
|
+
transformed_hash["#{key}"] = nil
|
|
351
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
352
|
+
# check to ensure the input is an array given that the attribute
|
|
353
|
+
# is documented as an array but the input is not
|
|
354
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
355
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
356
|
+
end
|
|
357
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
358
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
new(transformed_hash)
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Returns the object in the form of hash
|
|
365
|
+
# @return [Hash] Returns the object in the form of hash
|
|
366
|
+
def to_hash
|
|
367
|
+
hash = {}
|
|
368
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
369
|
+
value = self.send(attr)
|
|
370
|
+
if value.nil?
|
|
371
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
372
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
hash[param] = _to_hash(value)
|
|
376
|
+
end
|
|
377
|
+
hash
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
end
|