feratel-check-api-client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +159 -0
  4. data/Rakefile +10 -0
  5. data/docs/AgeGroup.md +22 -0
  6. data/docs/AgeGroupTranslation.md +20 -0
  7. data/docs/CheckPoint.md +38 -0
  8. data/docs/CheckPointGroup.md +20 -0
  9. data/docs/CheckPointItem.md +26 -0
  10. data/docs/CheckResourcesApi.md +545 -0
  11. data/docs/CheckResult.md +26 -0
  12. data/docs/CheckState.md +20 -0
  13. data/docs/CheckStateEnum.md +15 -0
  14. data/docs/CheckStateTranslation.md +20 -0
  15. data/docs/CheckpointError.md +22 -0
  16. data/docs/Customer.md +24 -0
  17. data/docs/History.md +18 -0
  18. data/docs/HistoryItem.md +24 -0
  19. data/docs/HistoryItemState.md +26 -0
  20. data/docs/Identification.md +36 -0
  21. data/docs/IdentificationStatus.md +15 -0
  22. data/docs/IdentificationType.md +26 -0
  23. data/docs/IdentificationUsage.md +26 -0
  24. data/docs/IdentificationUsageType.md +15 -0
  25. data/docs/Identifier.md +20 -0
  26. data/docs/IdentifierType.md +15 -0
  27. data/docs/ServiceProvider.md +24 -0
  28. data/docs/ServiceType.md +28 -0
  29. data/docs/ServiceTypeAssignment.md +22 -0
  30. data/docs/ServiceTypeTranslation.md +20 -0
  31. data/docs/ServiceUsage.md +36 -0
  32. data/docs/ServiceUsageType.md +15 -0
  33. data/docs/SystemResourcesApi.md +147 -0
  34. data/docs/TransactError.md +22 -0
  35. data/docs/TransactResult.md +34 -0
  36. data/docs/TransactState.md +20 -0
  37. data/docs/TransactStateEnum.md +15 -0
  38. data/docs/TransactStateTranslation.md +20 -0
  39. data/docs/ValidTransactionInfo.md +20 -0
  40. data/docs/Week.md +30 -0
  41. data/feratel-check-api-client.gemspec +39 -0
  42. data/git_push.sh +57 -0
  43. data/lib/feratel-check-api-client/api/check_resources_api.rb +586 -0
  44. data/lib/feratel-check-api-client/api/system_resources_api.rb +148 -0
  45. data/lib/feratel-check-api-client/api_client.rb +394 -0
  46. data/lib/feratel-check-api-client/api_error.rb +58 -0
  47. data/lib/feratel-check-api-client/configuration.rb +308 -0
  48. data/lib/feratel-check-api-client/models/age_group.rb +255 -0
  49. data/lib/feratel-check-api-client/models/age_group_translation.rb +223 -0
  50. data/lib/feratel-check-api-client/models/check_point.rb +327 -0
  51. data/lib/feratel-check-api-client/models/check_point_group.rb +244 -0
  52. data/lib/feratel-check-api-client/models/check_point_item.rb +271 -0
  53. data/lib/feratel-check-api-client/models/check_result.rb +250 -0
  54. data/lib/feratel-check-api-client/models/check_state.rb +247 -0
  55. data/lib/feratel-check-api-client/models/check_state_enum.rb +82 -0
  56. data/lib/feratel-check-api-client/models/check_state_translation.rb +223 -0
  57. data/lib/feratel-check-api-client/models/checkpoint_error.rb +256 -0
  58. data/lib/feratel-check-api-client/models/customer.rb +262 -0
  59. data/lib/feratel-check-api-client/models/history.rb +216 -0
  60. data/lib/feratel-check-api-client/models/history_item.rb +262 -0
  61. data/lib/feratel-check-api-client/models/history_item_state.rb +250 -0
  62. data/lib/feratel-check-api-client/models/identification.rb +338 -0
  63. data/lib/feratel-check-api-client/models/identification_status.rb +43 -0
  64. data/lib/feratel-check-api-client/models/identification_type.rb +271 -0
  65. data/lib/feratel-check-api-client/models/identification_usage.rb +314 -0
  66. data/lib/feratel-check-api-client/models/identification_usage_type.rb +42 -0
  67. data/lib/feratel-check-api-client/models/identifier.rb +245 -0
  68. data/lib/feratel-check-api-client/models/identifier_type.rb +44 -0
  69. data/lib/feratel-check-api-client/models/service_provider.rb +262 -0
  70. data/lib/feratel-check-api-client/models/service_type.rb +282 -0
  71. data/lib/feratel-check-api-client/models/service_type_assignment.rb +253 -0
  72. data/lib/feratel-check-api-client/models/service_type_translation.rb +223 -0
  73. data/lib/feratel-check-api-client/models/service_usage.rb +380 -0
  74. data/lib/feratel-check-api-client/models/service_usage_type.rb +50 -0
  75. data/lib/feratel-check-api-client/models/transact_error.rb +256 -0
  76. data/lib/feratel-check-api-client/models/transact_result.rb +349 -0
  77. data/lib/feratel-check-api-client/models/transact_state.rb +247 -0
  78. data/lib/feratel-check-api-client/models/transact_state_enum.rb +54 -0
  79. data/lib/feratel-check-api-client/models/transact_state_translation.rb +223 -0
  80. data/lib/feratel-check-api-client/models/valid_transaction_info.rb +223 -0
  81. data/lib/feratel-check-api-client/models/week.rb +268 -0
  82. data/lib/feratel-check-api-client/version.rb +15 -0
  83. data/lib/feratel-check-api-client.rb +75 -0
  84. data/spec/api/check_resources_api_spec.rb +137 -0
  85. data/spec/api/system_resources_api_spec.rb +59 -0
  86. data/spec/models/age_group_spec.rb +48 -0
  87. data/spec/models/age_group_translation_spec.rb +42 -0
  88. data/spec/models/check_point_group_spec.rb +42 -0
  89. data/spec/models/check_point_item_spec.rb +60 -0
  90. data/spec/models/check_point_spec.rb +96 -0
  91. data/spec/models/check_result_spec.rb +60 -0
  92. data/spec/models/check_state_enum_spec.rb +30 -0
  93. data/spec/models/check_state_spec.rb +42 -0
  94. data/spec/models/check_state_translation_spec.rb +42 -0
  95. data/spec/models/checkpoint_error_spec.rb +48 -0
  96. data/spec/models/customer_spec.rb +54 -0
  97. data/spec/models/history_item_spec.rb +54 -0
  98. data/spec/models/history_item_state_spec.rb +60 -0
  99. data/spec/models/history_spec.rb +36 -0
  100. data/spec/models/identification_spec.rb +90 -0
  101. data/spec/models/identification_status_spec.rb +30 -0
  102. data/spec/models/identification_type_spec.rb +60 -0
  103. data/spec/models/identification_usage_spec.rb +60 -0
  104. data/spec/models/identification_usage_type_spec.rb +30 -0
  105. data/spec/models/identifier_spec.rb +42 -0
  106. data/spec/models/identifier_type_spec.rb +30 -0
  107. data/spec/models/service_provider_spec.rb +54 -0
  108. data/spec/models/service_type_assignment_spec.rb +48 -0
  109. data/spec/models/service_type_spec.rb +66 -0
  110. data/spec/models/service_type_translation_spec.rb +42 -0
  111. data/spec/models/service_usage_spec.rb +90 -0
  112. data/spec/models/service_usage_type_spec.rb +30 -0
  113. data/spec/models/transact_error_spec.rb +48 -0
  114. data/spec/models/transact_result_spec.rb +84 -0
  115. data/spec/models/transact_state_enum_spec.rb +30 -0
  116. data/spec/models/transact_state_spec.rb +42 -0
  117. data/spec/models/transact_state_translation_spec.rb +42 -0
  118. data/spec/models/valid_transaction_info_spec.rb +42 -0
  119. data/spec/models/week_spec.rb +72 -0
  120. data/spec/spec_helper.rb +111 -0
  121. metadata +255 -0
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #CheckAPI Standard
3
+
4
+ #This documentation describes your available CheckAPI REST services: Get your checkpoints and their details, check the permission of a customer's ID, take a look at your checkpoint's history - everything a checkpoint needs can be found here in one place. Please look at the descriptions in each service below. <div id=\"authorize-information-wrap\"><h1>Authorize</h1><p>You can use this automated authentication to try out your activated methods - just click „Authorize“, enter CardAPI credentials and have a try! You received the CardAPI username and password via e-mail – credentials are different from your developer-portal credentials. Authentication is based on OAUTH2 (implicit grant flow) and needs to be implemented and called prior to using any API method. <b>CLIENT_ID</b><br>The client ID is pre-filled automatically according to the chosen application. You can find your available client IDs in the \"Applications\" - Area. <b>GRANT_TYPE</b><br>With grant_type=password you get an access-token and a refresh-token for your request. The received access token can be used for 10 minutes, there are two ways to renew it. Either you can send the same request again or you can use the grant_type=refresh_token. The refresh token needs to be used every 30 minutes and can provide new access tokens for 10 hours without using your credentials.</p></div>
5
+
6
+ The version of the OpenAPI document: 1.17.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FeratelCheckApiClient
17
+ class ServiceProvider
18
+ attr_accessor :id
19
+
20
+ attr_accessor :active
21
+
22
+ attr_accessor :code
23
+
24
+ attr_accessor :name
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'active' => :'active',
31
+ :'code' => :'code',
32
+ :'name' => :'name'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'String',
45
+ :'active' => :'Boolean',
46
+ :'code' => :'String',
47
+ :'name' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FeratelCheckApiClient::ServiceProvider` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FeratelCheckApiClient::ServiceProvider`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'id')
73
+ self.id = attributes[:'id']
74
+ end
75
+
76
+ if attributes.key?(:'active')
77
+ self.active = attributes[:'active']
78
+ end
79
+
80
+ if attributes.key?(:'code')
81
+ self.code = attributes[:'code']
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ pattern = Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
95
+ if !@id.nil? && @id !~ pattern
96
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if !@id.nil? && @id !~ Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] id Value to be assigned
112
+ def id=(id)
113
+ if id.nil?
114
+ fail ArgumentError, 'id cannot be nil'
115
+ end
116
+
117
+ pattern = Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
118
+ if id !~ pattern
119
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
120
+ end
121
+
122
+ @id = id
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ id == o.id &&
131
+ active == o.active &&
132
+ code == o.code &&
133
+ name == o.name
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [id, active, code, name].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ attributes = attributes.transform_keys(&:to_sym)
154
+ transformed_hash = {}
155
+ openapi_types.each_pair do |key, type|
156
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = nil
158
+ elsif type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[attribute_map[key]].is_a?(Array)
162
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
163
+ end
164
+ elsif !attributes[attribute_map[key]].nil?
165
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
166
+ end
167
+ end
168
+ new(transformed_hash)
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def self._deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = FeratelCheckApiClient.const_get(type)
210
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,282 @@
1
+ =begin
2
+ #CheckAPI Standard
3
+
4
+ #This documentation describes your available CheckAPI REST services: Get your checkpoints and their details, check the permission of a customer's ID, take a look at your checkpoint's history - everything a checkpoint needs can be found here in one place. Please look at the descriptions in each service below. <div id=\"authorize-information-wrap\"><h1>Authorize</h1><p>You can use this automated authentication to try out your activated methods - just click „Authorize“, enter CardAPI credentials and have a try! You received the CardAPI username and password via e-mail – credentials are different from your developer-portal credentials. Authentication is based on OAUTH2 (implicit grant flow) and needs to be implemented and called prior to using any API method. <b>CLIENT_ID</b><br>The client ID is pre-filled automatically according to the chosen application. You can find your available client IDs in the \"Applications\" - Area. <b>GRANT_TYPE</b><br>With grant_type=password you get an access-token and a refresh-token for your request. The received access token can be used for 10 minutes, there are two ways to renew it. Either you can send the same request again or you can use the grant_type=refresh_token. The refresh token needs to be used every 30 minutes and can provide new access tokens for 10 hours without using your credentials.</p></div>
5
+
6
+ The version of the OpenAPI document: 1.17.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FeratelCheckApiClient
17
+ class ServiceType
18
+ attr_accessor :id
19
+
20
+ attr_accessor :allow_list
21
+
22
+ attr_accessor :code
23
+
24
+ attr_accessor :provider
25
+
26
+ attr_accessor :translations
27
+
28
+ attr_accessor :usage
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id',
34
+ :'allow_list' => :'allowList',
35
+ :'code' => :'code',
36
+ :'provider' => :'provider',
37
+ :'translations' => :'translations',
38
+ :'usage' => :'usage'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'String',
51
+ :'allow_list' => :'Boolean',
52
+ :'code' => :'String',
53
+ :'provider' => :'ServiceProvider',
54
+ :'translations' => :'Array<ServiceTypeTranslation>',
55
+ :'usage' => :'ServiceUsage'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
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 `FeratelCheckApiClient::ServiceType` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FeratelCheckApiClient::ServiceType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'id')
81
+ self.id = attributes[:'id']
82
+ end
83
+
84
+ if attributes.key?(:'allow_list')
85
+ self.allow_list = attributes[:'allow_list']
86
+ end
87
+
88
+ if attributes.key?(:'code')
89
+ self.code = attributes[:'code']
90
+ end
91
+
92
+ if attributes.key?(:'provider')
93
+ self.provider = attributes[:'provider']
94
+ end
95
+
96
+ if attributes.key?(:'translations')
97
+ if (value = attributes[:'translations']).is_a?(Array)
98
+ self.translations = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'usage')
103
+ self.usage = attributes[:'usage']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ pattern = Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
113
+ if !@id.nil? && @id !~ pattern
114
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
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 !@id.nil? && @id !~ Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] id Value to be assigned
130
+ def id=(id)
131
+ if id.nil?
132
+ fail ArgumentError, 'id cannot be nil'
133
+ end
134
+
135
+ pattern = Regexp.new(/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/)
136
+ if id !~ pattern
137
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
138
+ end
139
+
140
+ @id = id
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ id == o.id &&
149
+ allow_list == o.allow_list &&
150
+ code == o.code &&
151
+ provider == o.provider &&
152
+ translations == o.translations &&
153
+ usage == o.usage
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [id, allow_list, code, provider, translations, usage].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def self._deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = FeratelCheckApiClient.const_get(type)
230
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end