korona-entry-client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +128 -0
  4. data/Rakefile +10 -0
  5. data/docs/BadRequestError.md +19 -0
  6. data/docs/EntryResponse.md +21 -0
  7. data/docs/ExternalTicketConfiguration.md +29 -0
  8. data/docs/ExternalTicketConfigurationList.md +17 -0
  9. data/docs/ExternalTicketConfigurationsApi.md +247 -0
  10. data/docs/ModelReference.md +23 -0
  11. data/docs/NotAcceptableError.md +19 -0
  12. data/docs/OrganizationalUnit.md +27 -0
  13. data/docs/OrganizationalUnitList.md +17 -0
  14. data/docs/OrganizationalUnitsApi.md +247 -0
  15. data/docs/Ticket.md +35 -0
  16. data/docs/TicketEntry.md +49 -0
  17. data/docs/TicketEntryLog.md +39 -0
  18. data/docs/TicketEntryLogList.md +17 -0
  19. data/docs/TicketImage.md +17 -0
  20. data/docs/TicketInformation.md +27 -0
  21. data/docs/TicketList.md +17 -0
  22. data/docs/TicketPersonalization.md +21 -0
  23. data/docs/TicketsApi.md +654 -0
  24. data/git_push.sh +58 -0
  25. data/korona-entry-client.gemspec +39 -0
  26. data/lib/korona-entry-client.rb +58 -0
  27. data/lib/korona-entry-client/api/external_ticket_configurations_api.rb +356 -0
  28. data/lib/korona-entry-client/api/organizational_units_api.rb +356 -0
  29. data/lib/korona-entry-client/api/tickets_api.rb +854 -0
  30. data/lib/korona-entry-client/api_client.rb +386 -0
  31. data/lib/korona-entry-client/api_error.rb +57 -0
  32. data/lib/korona-entry-client/configuration.rb +248 -0
  33. data/lib/korona-entry-client/models/bad_request_error.rb +217 -0
  34. data/lib/korona-entry-client/models/entry_response.rb +226 -0
  35. data/lib/korona-entry-client/models/external_ticket_configuration.rb +304 -0
  36. data/lib/korona-entry-client/models/external_ticket_configuration_list.rb +214 -0
  37. data/lib/korona-entry-client/models/model_reference.rb +238 -0
  38. data/lib/korona-entry-client/models/not_acceptable_error.rb +250 -0
  39. data/lib/korona-entry-client/models/organizational_unit.rb +257 -0
  40. data/lib/korona-entry-client/models/organizational_unit_list.rb +214 -0
  41. data/lib/korona-entry-client/models/ticket.rb +299 -0
  42. data/lib/korona-entry-client/models/ticket_entry.rb +403 -0
  43. data/lib/korona-entry-client/models/ticket_entry_log.rb +374 -0
  44. data/lib/korona-entry-client/models/ticket_entry_log_list.rb +214 -0
  45. data/lib/korona-entry-client/models/ticket_image.rb +215 -0
  46. data/lib/korona-entry-client/models/ticket_information.rb +258 -0
  47. data/lib/korona-entry-client/models/ticket_list.rb +214 -0
  48. data/lib/korona-entry-client/models/ticket_personalization.rb +228 -0
  49. data/lib/korona-entry-client/version.rb +15 -0
  50. data/spec/api/external_ticket_configurations_api_spec.rb +95 -0
  51. data/spec/api/organizational_units_api_spec.rb +95 -0
  52. data/spec/api/tickets_api_spec.rb +191 -0
  53. data/spec/api_client_spec.rb +226 -0
  54. data/spec/configuration_spec.rb +42 -0
  55. data/spec/models/bad_request_error_spec.rb +47 -0
  56. data/spec/models/entry_response_spec.rb +53 -0
  57. data/spec/models/external_ticket_configuration_list_spec.rb +41 -0
  58. data/spec/models/external_ticket_configuration_spec.rb +77 -0
  59. data/spec/models/model_reference_spec.rb +59 -0
  60. data/spec/models/not_acceptable_error_spec.rb +51 -0
  61. data/spec/models/organizational_unit_list_spec.rb +41 -0
  62. data/spec/models/organizational_unit_spec.rb +71 -0
  63. data/spec/models/ticket_entry_log_list_spec.rb +41 -0
  64. data/spec/models/ticket_entry_log_spec.rb +119 -0
  65. data/spec/models/ticket_entry_spec.rb +137 -0
  66. data/spec/models/ticket_image_spec.rb +41 -0
  67. data/spec/models/ticket_information_spec.rb +71 -0
  68. data/spec/models/ticket_list_spec.rb +41 -0
  69. data/spec/models/ticket_personalization_spec.rb +53 -0
  70. data/spec/models/ticket_spec.rb +95 -0
  71. data/spec/spec_helper.rb +111 -0
  72. metadata +196 -0
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #KORONA.entry API v1
3
+
4
+ #Our api provides access to our entry services
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module KoronaEntryClient
16
+ class NotAcceptableError
17
+ # A short description of the error in english.
18
+ attr_accessor :message
19
+
20
+ attr_accessor :response
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
+ :'message' => :'message',
48
+ :'response' => :'response'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'message' => :'String',
56
+ :'response' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaEntryClient::NotAcceptableError` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KoronaEntryClient::NotAcceptableError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'message')
82
+ self.message = attributes[:'message']
83
+ end
84
+
85
+ if attributes.key?(:'response')
86
+ self.response = attributes[:'response']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ response_validator = EnumAttributeValidator.new('String', ["BEFORETIME", "DENIED", "DOESNTEXIST", "EXHAUSTED", "INVALID", "LOCKED", "SUSPENDED", "TIMEUP", "TIME_QUOTA_OVERDRAWN", "SUCCESS"])
101
+ return false unless response_validator.valid?(@response)
102
+ true
103
+ end
104
+
105
+ # Custom attribute writer method checking allowed values (enum).
106
+ # @param [Object] response Object to be assigned
107
+ def response=(response)
108
+ validator = EnumAttributeValidator.new('String', ["BEFORETIME", "DENIED", "DOESNTEXIST", "EXHAUSTED", "INVALID", "LOCKED", "SUSPENDED", "TIMEUP", "TIME_QUOTA_OVERDRAWN", "SUCCESS"])
109
+ unless validator.valid?(response)
110
+ fail ArgumentError, "invalid value for \"response\", must be one of #{validator.allowable_values}."
111
+ end
112
+ @response = response
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ message == o.message &&
121
+ response == o.response
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [message, response].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ new.build_from_hash(attributes)
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ DateTime.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ KoronaEntryClient.const_get(type).build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+ end
250
+ end
@@ -0,0 +1,257 @@
1
+ =begin
2
+ #KORONA.entry API v1
3
+
4
+ #Our api provides access to our entry services
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module KoronaEntryClient
16
+ # Defines the organizational structure of the entry gates/acces points.
17
+ class OrganizationalUnit
18
+ # Objects ID.
19
+ attr_accessor :id
20
+
21
+ # Number of organizational unit.
22
+ attr_accessor :number
23
+
24
+ # Name of organizational unit.
25
+ attr_accessor :name
26
+
27
+ # *True*, if this organizational unit is an entry gate.
28
+ attr_accessor :entry_gate
29
+
30
+ # *True*, if this organizational unit has children.
31
+ attr_accessor :has_children
32
+
33
+ attr_accessor :parent
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'id' => :'id',
39
+ :'number' => :'number',
40
+ :'name' => :'name',
41
+ :'entry_gate' => :'entryGate',
42
+ :'has_children' => :'hasChildren',
43
+ :'parent' => :'parent'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'Integer',
51
+ :'number' => :'String',
52
+ :'name' => :'String',
53
+ :'entry_gate' => :'Boolean',
54
+ :'has_children' => :'Boolean',
55
+ :'parent' => :'ModelReference'
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 `KoronaEntryClient::OrganizationalUnit` 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 `KoronaEntryClient::OrganizationalUnit`. 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?(:'number')
85
+ self.number = attributes[:'number']
86
+ end
87
+
88
+ if attributes.key?(:'name')
89
+ self.name = attributes[:'name']
90
+ end
91
+
92
+ if attributes.key?(:'entry_gate')
93
+ self.entry_gate = attributes[:'entry_gate']
94
+ end
95
+
96
+ if attributes.key?(:'has_children')
97
+ self.has_children = attributes[:'has_children']
98
+ end
99
+
100
+ if attributes.key?(:'parent')
101
+ self.parent = attributes[:'parent']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ id == o.id &&
124
+ number == o.number &&
125
+ name == o.name &&
126
+ entry_gate == o.entry_gate &&
127
+ has_children == o.has_children &&
128
+ parent == o.parent
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [id, number, name, entry_gate, has_children, parent].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ new.build_from_hash(attributes)
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.openapi_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !attributes[self.class.attribute_map[key]].nil?
163
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :DateTime
177
+ DateTime.parse(value)
178
+ when :Date
179
+ Date.parse(value)
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :Boolean
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else # model
207
+ KoronaEntryClient.const_get(type).build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+ end
257
+ end