korona-entry-client 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,7 +128,7 @@ module KoronaEntryClient
128
128
  def initialize
129
129
  @scheme = 'https'
130
130
  @host = 'YourLocalInstance.com'
131
- @base_path = '/korona.entry_server/services/v1'
131
+ @base_path = '/korona.entry/services/v1'
132
132
  @api_key = {}
133
133
  @api_key_prefix = {}
134
134
  @timeout = 0
@@ -207,7 +207,7 @@ module KoronaEntryClient
207
207
  def server_settings
208
208
  [
209
209
  {
210
- url: "https://YourLocalInstance.com/korona.entry_server/services/v1",
210
+ url: "https://YourLocalInstance.com/korona.entry/services/v1",
211
211
  description: "No description provided",
212
212
  }
213
213
  ]
@@ -0,0 +1,321 @@
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 StatisticGroupedEntry
17
+ attr_accessor :article_number
18
+
19
+ attr_accessor :year
20
+
21
+ attr_accessor :month
22
+
23
+ attr_accessor :day
24
+
25
+ attr_accessor :hour
26
+
27
+ attr_accessor :commit_type
28
+
29
+ attr_accessor :entries
30
+
31
+ attr_accessor :tickets
32
+
33
+ attr_accessor :organizational_unit_number
34
+
35
+ attr_accessor :tag
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'article_number' => :'articleNumber',
63
+ :'year' => :'year',
64
+ :'month' => :'month',
65
+ :'day' => :'day',
66
+ :'hour' => :'hour',
67
+ :'commit_type' => :'commitType',
68
+ :'entries' => :'entries',
69
+ :'tickets' => :'tickets',
70
+ :'organizational_unit_number' => :'organizationalUnitNumber',
71
+ :'tag' => :'tag'
72
+ }
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'article_number' => :'String',
79
+ :'year' => :'Integer',
80
+ :'month' => :'Integer',
81
+ :'day' => :'Integer',
82
+ :'hour' => :'Integer',
83
+ :'commit_type' => :'String',
84
+ :'entries' => :'Integer',
85
+ :'tickets' => :'Integer',
86
+ :'organizational_unit_number' => :'String',
87
+ :'tag' => :'String'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaEntryClient::StatisticGroupedEntry` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KoronaEntryClient::StatisticGroupedEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'article_number')
113
+ self.article_number = attributes[:'article_number']
114
+ end
115
+
116
+ if attributes.key?(:'year')
117
+ self.year = attributes[:'year']
118
+ end
119
+
120
+ if attributes.key?(:'month')
121
+ self.month = attributes[:'month']
122
+ end
123
+
124
+ if attributes.key?(:'day')
125
+ self.day = attributes[:'day']
126
+ end
127
+
128
+ if attributes.key?(:'hour')
129
+ self.hour = attributes[:'hour']
130
+ end
131
+
132
+ if attributes.key?(:'commit_type')
133
+ self.commit_type = attributes[:'commit_type']
134
+ end
135
+
136
+ if attributes.key?(:'entries')
137
+ self.entries = attributes[:'entries']
138
+ end
139
+
140
+ if attributes.key?(:'tickets')
141
+ self.tickets = attributes[:'tickets']
142
+ end
143
+
144
+ if attributes.key?(:'organizational_unit_number')
145
+ self.organizational_unit_number = attributes[:'organizational_unit_number']
146
+ end
147
+
148
+ if attributes.key?(:'tag')
149
+ self.tag = attributes[:'tag']
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = Array.new
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ commit_type_validator = EnumAttributeValidator.new('String', ["ACCESS", "EXIT"])
164
+ return false unless commit_type_validator.valid?(@commit_type)
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] commit_type Object to be assigned
170
+ def commit_type=(commit_type)
171
+ validator = EnumAttributeValidator.new('String', ["ACCESS", "EXIT"])
172
+ unless validator.valid?(commit_type)
173
+ fail ArgumentError, "invalid value for \"commit_type\", must be one of #{validator.allowable_values}."
174
+ end
175
+ @commit_type = commit_type
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ article_number == o.article_number &&
184
+ year == o.year &&
185
+ month == o.month &&
186
+ day == o.day &&
187
+ hour == o.hour &&
188
+ commit_type == o.commit_type &&
189
+ entries == o.entries &&
190
+ tickets == o.tickets &&
191
+ organizational_unit_number == o.organizational_unit_number &&
192
+ tag == o.tag
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Integer] Hash code
203
+ def hash
204
+ [article_number, year, month, day, hour, commit_type, entries, tickets, organizational_unit_number, tag].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def self.build_from_hash(attributes)
211
+ new.build_from_hash(attributes)
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ self.class.openapi_types.each_pair do |key, type|
220
+ if type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
224
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !attributes[self.class.attribute_map[key]].nil?
227
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
228
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
229
+ end
230
+
231
+ self
232
+ end
233
+
234
+ # Deserializes the data based on type
235
+ # @param string type Data type
236
+ # @param string value Value to be deserialized
237
+ # @return [Object] Deserialized data
238
+ def _deserialize(type, value)
239
+ case type.to_sym
240
+ when :DateTime
241
+ DateTime.parse(value)
242
+ when :Date
243
+ Date.parse(value)
244
+ when :String
245
+ value.to_s
246
+ when :Integer
247
+ value.to_i
248
+ when :Float
249
+ value.to_f
250
+ when :Boolean
251
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
252
+ true
253
+ else
254
+ false
255
+ end
256
+ when :Object
257
+ # generic object (usually a Hash), return directly
258
+ value
259
+ when /\AArray<(?<inner_type>.+)>\z/
260
+ inner_type = Regexp.last_match[:inner_type]
261
+ value.map { |v| _deserialize(inner_type, v) }
262
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
263
+ k_type = Regexp.last_match[:k_type]
264
+ v_type = Regexp.last_match[:v_type]
265
+ {}.tap do |hash|
266
+ value.each do |k, v|
267
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
268
+ end
269
+ end
270
+ else # model
271
+ KoronaEntryClient.const_get(type).build_from_hash(value)
272
+ end
273
+ end
274
+
275
+ # Returns the string representation of the object
276
+ # @return [String] String presentation of the object
277
+ def to_s
278
+ to_hash.to_s
279
+ end
280
+
281
+ # to_body is an alias to to_hash (backward compatibility)
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_body
284
+ to_hash
285
+ end
286
+
287
+ # Returns the object in the form of hash
288
+ # @return [Hash] Returns the object in the form of hash
289
+ def to_hash
290
+ hash = {}
291
+ self.class.attribute_map.each_pair do |attr, param|
292
+ value = self.send(attr)
293
+ if value.nil?
294
+ is_nullable = self.class.openapi_nullable.include?(attr)
295
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
296
+ end
297
+
298
+ hash[param] = _to_hash(value)
299
+ end
300
+ hash
301
+ end
302
+
303
+ # Outputs non-array value in the form of hash
304
+ # For object, use to_hash. Otherwise, just return the value
305
+ # @param [Object] value Any valid value
306
+ # @return [Hash] Returns the value in the form of hash
307
+ def _to_hash(value)
308
+ if value.is_a?(Array)
309
+ value.compact.map { |v| _to_hash(v) }
310
+ elsif value.is_a?(Hash)
311
+ {}.tap do |hash|
312
+ value.each { |k, v| hash[k] = _to_hash(v) }
313
+ end
314
+ elsif value.respond_to? :to_hash
315
+ value.to_hash
316
+ else
317
+ value
318
+ end
319
+ end
320
+ end
321
+ end
@@ -65,6 +65,9 @@ module KoronaEntryClient
65
65
  # Specifies how many seconds the ticket should be locked after a successful entry.
66
66
  attr_accessor :re_entry_lock
67
67
 
68
+ # Specifies a time period after which the ticket is locked from the first use. The standard ISO 8601 format is used - PyYmMwWdDThHmMsS. Note that weeks should not be shown if any other field is present and vice versa.
69
+ attr_accessor :lock_for_period_after_use
70
+
68
71
  # Attribute mapping from ruby-style variable name to JSON key.
69
72
  def self.attribute_map
70
73
  {
@@ -84,7 +87,8 @@ module KoronaEntryClient
84
87
  :'entry_gates' => :'entryGates',
85
88
  :'information' => :'information',
86
89
  :'locked_to' => :'lockedTo',
87
- :'re_entry_lock' => :'reEntryLock'
90
+ :'re_entry_lock' => :'reEntryLock',
91
+ :'lock_for_period_after_use' => :'lockForPeriodAfterUse'
88
92
  }
89
93
  end
90
94
 
@@ -107,7 +111,8 @@ module KoronaEntryClient
107
111
  :'entry_gates' => :'Array<String>',
108
112
  :'information' => :'TicketInformation',
109
113
  :'locked_to' => :'DateTime',
110
- :'re_entry_lock' => :'Integer'
114
+ :'re_entry_lock' => :'Integer',
115
+ :'lock_for_period_after_use' => :'String'
111
116
  }
112
117
  end
113
118
 
@@ -201,6 +206,10 @@ module KoronaEntryClient
201
206
  if attributes.key?(:'re_entry_lock')
202
207
  self.re_entry_lock = attributes[:'re_entry_lock']
203
208
  end
209
+
210
+ if attributes.key?(:'lock_for_period_after_use')
211
+ self.lock_for_period_after_use = attributes[:'lock_for_period_after_use']
212
+ end
204
213
  end
205
214
 
206
215
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -271,7 +280,8 @@ module KoronaEntryClient
271
280
  entry_gates == o.entry_gates &&
272
281
  information == o.information &&
273
282
  locked_to == o.locked_to &&
274
- re_entry_lock == o.re_entry_lock
283
+ re_entry_lock == o.re_entry_lock &&
284
+ lock_for_period_after_use == o.lock_for_period_after_use
275
285
  end
276
286
 
277
287
  # @see the `==` method
@@ -283,7 +293,7 @@ module KoronaEntryClient
283
293
  # Calculates hash code according to all attributes.
284
294
  # @return [Integer] Hash code
285
295
  def hash
286
- [id, create_date, used_up, first_use, last_use, last_exit, uses, uses_max, valid_from, valid_to, valid_from_time, valid_to_time, lock_after_use, entry_gates, information, locked_to, re_entry_lock].hash
296
+ [id, create_date, used_up, first_use, last_use, last_exit, uses, uses_max, valid_from, valid_to, valid_from_time, valid_to_time, lock_after_use, entry_gates, information, locked_to, re_entry_lock, lock_for_period_after_use].hash
287
297
  end
288
298
 
289
299
  # Builds the object from hash
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.3.0
13
13
  require 'date'
14
14
 
15
15
  module KoronaEntryClient
16
- # Represents a ticket log entry, f.e. created by update, check or access.
16
+ # Represents a tickte log entry, f.e. created by update, check or access.
17
17
  class TicketEntryLog
18
18
  # Objects ID.
19
19
  attr_accessor :id
@@ -46,9 +46,6 @@ module KoronaEntryClient
46
46
  # Identification of commit type.
47
47
  attr_accessor :commit_type
48
48
 
49
- # Time of testing.
50
- attr_accessor :test_time
51
-
52
49
  class EnumAttributeValidator
53
50
  attr_reader :datatype
54
51
  attr_reader :allowable_values
@@ -84,8 +81,7 @@ module KoronaEntryClient
84
81
  :'organizational_unit_number' => :'organizationalUnitNumber',
85
82
  :'client' => :'client',
86
83
  :'number_of_uses' => :'numberOfUses',
87
- :'commit_type' => :'commitType',
88
- :'test_time' => :'testTime'
84
+ :'commit_type' => :'commitType'
89
85
  }
90
86
  end
91
87
 
@@ -102,8 +98,7 @@ module KoronaEntryClient
102
98
  :'organizational_unit_number' => :'String',
103
99
  :'client' => :'String',
104
100
  :'number_of_uses' => :'Integer',
105
- :'commit_type' => :'String',
106
- :'test_time' => :'DateTime'
101
+ :'commit_type' => :'String'
107
102
  }
108
103
  end
109
104
 
@@ -171,10 +166,6 @@ module KoronaEntryClient
171
166
  if attributes.key?(:'commit_type')
172
167
  self.commit_type = attributes[:'commit_type']
173
168
  end
174
-
175
- if attributes.key?(:'test_time')
176
- self.test_time = attributes[:'test_time']
177
- end
178
169
  end
179
170
 
180
171
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -241,8 +232,7 @@ module KoronaEntryClient
241
232
  organizational_unit_number == o.organizational_unit_number &&
242
233
  client == o.client &&
243
234
  number_of_uses == o.number_of_uses &&
244
- commit_type == o.commit_type &&
245
- test_time == o.test_time
235
+ commit_type == o.commit_type
246
236
  end
247
237
 
248
238
  # @see the `==` method
@@ -254,7 +244,7 @@ module KoronaEntryClient
254
244
  # Calculates hash code according to all attributes.
255
245
  # @return [Integer] Hash code
256
246
  def hash
257
- [id, comment, ticket, ticket_entry, log_type, response, time, organizational_unit_number, client, number_of_uses, commit_type, test_time].hash
247
+ [id, comment, ticket, ticket_entry, log_type, response, time, organizational_unit_number, client, number_of_uses, commit_type].hash
258
248
  end
259
249
 
260
250
  # Builds the object from hash