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,314 @@
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 IdentificationUsage
18
+ attr_accessor :count_n
19
+
20
+ attr_accessor :count_m
21
+
22
+ attr_accessor :from_date
23
+
24
+ attr_accessor :to_date
25
+
26
+ attr_accessor :type
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'count_n' => :'countN',
54
+ :'count_m' => :'countM',
55
+ :'from_date' => :'fromDate',
56
+ :'to_date' => :'toDate',
57
+ :'type' => :'type'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'count_n' => :'Integer',
70
+ :'count_m' => :'Integer',
71
+ :'from_date' => :'String',
72
+ :'to_date' => :'String',
73
+ :'type' => :'IdentificationUsageType'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FeratelCheckApiClient::IdentificationUsage` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FeratelCheckApiClient::IdentificationUsage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'count_n')
99
+ self.count_n = attributes[:'count_n']
100
+ end
101
+
102
+ if attributes.key?(:'count_m')
103
+ self.count_m = attributes[:'count_m']
104
+ end
105
+
106
+ if attributes.key?(:'from_date')
107
+ self.from_date = attributes[:'from_date']
108
+ end
109
+
110
+ if attributes.key?(:'to_date')
111
+ self.to_date = attributes[:'to_date']
112
+ end
113
+
114
+ if attributes.key?(:'type')
115
+ self.type = attributes[:'type']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
125
+ if !@from_date.nil? && @from_date !~ pattern
126
+ invalid_properties.push("invalid value for \"from_date\", must conform to the pattern #{pattern}.")
127
+ end
128
+
129
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
130
+ if !@to_date.nil? && @to_date !~ pattern
131
+ invalid_properties.push("invalid value for \"to_date\", must conform to the pattern #{pattern}.")
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if !@from_date.nil? && @from_date !~ Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
142
+ return false if !@to_date.nil? && @to_date !~ Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] from_date Value to be assigned
148
+ def from_date=(from_date)
149
+ if from_date.nil?
150
+ fail ArgumentError, 'from_date cannot be nil'
151
+ end
152
+
153
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
154
+ if from_date !~ pattern
155
+ fail ArgumentError, "invalid value for \"from_date\", must conform to the pattern #{pattern}."
156
+ end
157
+
158
+ @from_date = from_date
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] to_date Value to be assigned
163
+ def to_date=(to_date)
164
+ if to_date.nil?
165
+ fail ArgumentError, 'to_date cannot be nil'
166
+ end
167
+
168
+ pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?$/)
169
+ if to_date !~ pattern
170
+ fail ArgumentError, "invalid value for \"to_date\", must conform to the pattern #{pattern}."
171
+ end
172
+
173
+ @to_date = to_date
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ count_n == o.count_n &&
182
+ count_m == o.count_m &&
183
+ from_date == o.from_date &&
184
+ to_date == o.to_date &&
185
+ type == o.type
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [count_n, count_m, from_date, to_date, type].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ transformed_hash = {}
207
+ openapi_types.each_pair do |key, type|
208
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = nil
210
+ elsif type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[attribute_map[key]].is_a?(Array)
214
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
215
+ end
216
+ elsif !attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
218
+ end
219
+ end
220
+ new(transformed_hash)
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def self._deserialize(type, value)
228
+ case type.to_sym
229
+ when :Time
230
+ Time.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ # models (e.g. Pet) or oneOf
261
+ klass = FeratelCheckApiClient.const_get(type)
262
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
+ end
264
+ end
265
+
266
+ # Returns the string representation of the object
267
+ # @return [String] String presentation of the object
268
+ def to_s
269
+ to_hash.to_s
270
+ end
271
+
272
+ # to_body is an alias to to_hash (backward compatibility)
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_body
275
+ to_hash
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ # Outputs non-array value in the form of hash
295
+ # For object, use to_hash. Otherwise, just return the value
296
+ # @param [Object] value Any valid value
297
+ # @return [Hash] Returns the value in the form of hash
298
+ def _to_hash(value)
299
+ if value.is_a?(Array)
300
+ value.compact.map { |v| _to_hash(v) }
301
+ elsif value.is_a?(Hash)
302
+ {}.tap do |hash|
303
+ value.each { |k, v| hash[k] = _to_hash(v) }
304
+ end
305
+ elsif value.respond_to? :to_hash
306
+ value.to_hash
307
+ else
308
+ value
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end
@@ -0,0 +1,42 @@
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 IdentificationUsageType
18
+ N_DAYS_FROM_FIRST_USE = "N_DAYS_FROM_FIRST_USE".freeze
19
+ N_DAYS_IN_M_DAYS_FROM_FIRST_USE = "N_DAYS_IN_M_DAYS_FROM_FIRST_USE".freeze
20
+ N_MINUTES_FROM_FIRST_USE = "N_MINUTES_FROM_FIRST_USE".freeze
21
+ UNDEFINED = "UNDEFINED".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [N_DAYS_FROM_FIRST_USE, N_DAYS_IN_M_DAYS_FROM_FIRST_USE, N_MINUTES_FROM_FIRST_USE, UNDEFINED].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if IdentificationUsageType.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #IdentificationUsageType"
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,245 @@
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 Identifier
18
+ attr_accessor :identifier
19
+
20
+ attr_accessor :type
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'identifier' => :'identifier',
48
+ :'type' => :'type'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'identifier' => :'String',
61
+ :'type' => :'IdentifierType'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FeratelCheckApiClient::Identifier` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FeratelCheckApiClient::Identifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'identifier')
87
+ self.identifier = attributes[:'identifier']
88
+ end
89
+
90
+ if attributes.key?(:'type')
91
+ self.type = attributes[:'type']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ identifier == o.identifier &&
116
+ type == o.type
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [identifier, type].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ attributes = attributes.transform_keys(&:to_sym)
137
+ transformed_hash = {}
138
+ openapi_types.each_pair do |key, type|
139
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = nil
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[attribute_map[key]].is_a?(Array)
145
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
146
+ end
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
149
+ end
150
+ end
151
+ new(transformed_hash)
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def self._deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = FeratelCheckApiClient.const_get(type)
193
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+
243
+ end
244
+
245
+ end
@@ -0,0 +1,44 @@
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 IdentifierType
18
+ BY_CARD_ID = "BY_CARD_ID".freeze
19
+ BY_CARD_NUMBER = "BY_CARD_NUMBER".freeze
20
+ BY_EXTERNAL_ID = "BY_EXTERNAL_ID".freeze
21
+ BY_EXTERNAL_ID_2 = "BY_EXTERNAL_ID_2".freeze
22
+ BY_ID = "BY_ID".freeze
23
+ UNKNOWN = "UNKNOWN".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [BY_CARD_ID, BY_CARD_NUMBER, BY_EXTERNAL_ID, BY_EXTERNAL_ID_2, BY_ID, UNKNOWN].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if IdentifierType.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #IdentifierType"
42
+ end
43
+ end
44
+ end