korona-entry-client 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ require 'korona-entry-client/models/model_reference'
25
25
  require 'korona-entry-client/models/not_acceptable_error'
26
26
  require 'korona-entry-client/models/organizational_unit'
27
27
  require 'korona-entry-client/models/organizational_unit_list'
28
+ require 'korona-entry-client/models/statistic_grouped_entry'
28
29
  require 'korona-entry-client/models/ticket'
29
30
  require 'korona-entry-client/models/ticket_entry'
30
31
  require 'korona-entry-client/models/ticket_entry_log'
@@ -37,6 +38,7 @@ require 'korona-entry-client/models/ticket_personalization'
37
38
  # APIs
38
39
  require 'korona-entry-client/api/external_ticket_configurations_api'
39
40
  require 'korona-entry-client/api/organizational_units_api'
41
+ require 'korona-entry-client/api/statistics_api'
40
42
  require 'korona-entry-client/api/tickets_api'
41
43
 
42
44
  module KoronaEntryClient
@@ -0,0 +1,126 @@
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 'cgi'
14
+
15
+ module KoronaEntryClient
16
+ class StatisticsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Prepares entries statistically and returns them as a list.
23
+ # @param client [String] Identification of executing client.
24
+ # @param time_from [DateTime] Log time from.
25
+ # @param time_to [DateTime] Log time to.
26
+ # @param ticket_type [String]
27
+ # @param grouped_entries_type [String]
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [Array<String>] :organizational_unit_numbers
30
+ # @option opts [Array<String>] :tags
31
+ # @return [Array<StatisticGroupedEntry>]
32
+ def load_grouped_entries(client, time_from, time_to, ticket_type, grouped_entries_type, opts = {})
33
+ data, _status_code, _headers = load_grouped_entries_with_http_info(client, time_from, time_to, ticket_type, grouped_entries_type, opts)
34
+ data
35
+ end
36
+
37
+ # Prepares entries statistically and returns them as a list.
38
+ # @param client [String] Identification of executing client.
39
+ # @param time_from [DateTime] Log time from.
40
+ # @param time_to [DateTime] Log time to.
41
+ # @param ticket_type [String]
42
+ # @param grouped_entries_type [String]
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [Array<String>] :organizational_unit_numbers
45
+ # @option opts [Array<String>] :tags
46
+ # @return [Array<(Array<StatisticGroupedEntry>, Integer, Hash)>] Array<StatisticGroupedEntry> data, response status code and response headers
47
+ def load_grouped_entries_with_http_info(client, time_from, time_to, ticket_type, grouped_entries_type, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: StatisticsApi.load_grouped_entries ...'
50
+ end
51
+ # verify the required parameter 'client' is set
52
+ if @api_client.config.client_side_validation && client.nil?
53
+ fail ArgumentError, "Missing the required parameter 'client' when calling StatisticsApi.load_grouped_entries"
54
+ end
55
+ # verify the required parameter 'time_from' is set
56
+ if @api_client.config.client_side_validation && time_from.nil?
57
+ fail ArgumentError, "Missing the required parameter 'time_from' when calling StatisticsApi.load_grouped_entries"
58
+ end
59
+ # verify the required parameter 'time_to' is set
60
+ if @api_client.config.client_side_validation && time_to.nil?
61
+ fail ArgumentError, "Missing the required parameter 'time_to' when calling StatisticsApi.load_grouped_entries"
62
+ end
63
+ # verify the required parameter 'ticket_type' is set
64
+ if @api_client.config.client_side_validation && ticket_type.nil?
65
+ fail ArgumentError, "Missing the required parameter 'ticket_type' when calling StatisticsApi.load_grouped_entries"
66
+ end
67
+ # verify enum value
68
+ allowable_values = ["ALL_TICKETS", "INTERNAL_TICKETS", "EXTERNAL_TICKETS"]
69
+ if @api_client.config.client_side_validation && !allowable_values.include?(ticket_type)
70
+ fail ArgumentError, "invalid value for \"ticket_type\", must be one of #{allowable_values}"
71
+ end
72
+ # verify the required parameter 'grouped_entries_type' is set
73
+ if @api_client.config.client_side_validation && grouped_entries_type.nil?
74
+ fail ArgumentError, "Missing the required parameter 'grouped_entries_type' when calling StatisticsApi.load_grouped_entries"
75
+ end
76
+ # verify enum value
77
+ allowable_values = ["DAY", "DAY_UNIQUE_TICKETS", "HOUR", "ENTRY_GATES"]
78
+ if @api_client.config.client_side_validation && !allowable_values.include?(grouped_entries_type)
79
+ fail ArgumentError, "invalid value for \"grouped_entries_type\", must be one of #{allowable_values}"
80
+ end
81
+ # resource path
82
+ local_var_path = '/{client}/statistics/groupedEntries'.sub('{' + 'client' + '}', CGI.escape(client.to_s))
83
+
84
+ # query parameters
85
+ query_params = opts[:query_params] || {}
86
+ query_params[:'timeFrom'] = time_from
87
+ query_params[:'timeTo'] = time_to
88
+ query_params[:'ticketType'] = ticket_type
89
+ query_params[:'groupedEntriesType'] = grouped_entries_type
90
+ query_params[:'organizationalUnitNumbers'] = @api_client.build_collection_param(opts[:'organizational_unit_numbers'], :multi) if !opts[:'organizational_unit_numbers'].nil?
91
+ query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].nil?
92
+
93
+ # header parameters
94
+ header_params = opts[:header_params] || {}
95
+ # HTTP header 'Accept' (if needed)
96
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
97
+
98
+ # form parameters
99
+ form_params = opts[:form_params] || {}
100
+
101
+ # http body (model)
102
+ post_body = opts[:body]
103
+
104
+ # return_type
105
+ return_type = opts[:return_type] || 'Array<StatisticGroupedEntry>'
106
+
107
+ # auth_names
108
+ auth_names = opts[:auth_names] || []
109
+
110
+ new_options = opts.merge(
111
+ :header_params => header_params,
112
+ :query_params => query_params,
113
+ :form_params => form_params,
114
+ :body => post_body,
115
+ :auth_names => auth_names,
116
+ :return_type => return_type
117
+ )
118
+
119
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: StatisticsApi#load_grouped_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+ end
126
+ end
@@ -87,7 +87,7 @@ module KoronaEntryClient
87
87
  return_type = opts[:return_type] || 'EntryResponse'
88
88
 
89
89
  # auth_names
90
- auth_names = opts[:auth_names] || ['basicAuth']
90
+ auth_names = opts[:auth_names] || []
91
91
 
92
92
  new_options = opts.merge(
93
93
  :header_params => header_params,
@@ -155,7 +155,7 @@ module KoronaEntryClient
155
155
  return_type = opts[:return_type] || 'ModelReference'
156
156
 
157
157
  # auth_names
158
- auth_names = opts[:auth_names] || ['basicAuth']
158
+ auth_names = opts[:auth_names] || []
159
159
 
160
160
  new_options = opts.merge(
161
161
  :header_params => header_params,
@@ -173,6 +173,80 @@ module KoronaEntryClient
173
173
  return data, status_code, headers
174
174
  end
175
175
 
176
+ # Creates a new ticket entry for a specific ticket.
177
+ # @param client [String] Identification of executing client.
178
+ # @param ticket_id [Integer] ID to identify the ticket.
179
+ # @param body [TicketEntry] Properties to update of the ticket entry.
180
+ # @param [Hash] opts the optional parameters
181
+ # @return [ModelReference]
182
+ def create_ticket_entry(client, ticket_id, body, opts = {})
183
+ data, _status_code, _headers = create_ticket_entry_with_http_info(client, ticket_id, body, opts)
184
+ data
185
+ end
186
+
187
+ # Creates a new ticket entry for a specific ticket.
188
+ # @param client [String] Identification of executing client.
189
+ # @param ticket_id [Integer] ID to identify the ticket.
190
+ # @param body [TicketEntry] Properties to update of the ticket entry.
191
+ # @param [Hash] opts the optional parameters
192
+ # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers
193
+ def create_ticket_entry_with_http_info(client, ticket_id, body, opts = {})
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug 'Calling API: TicketsApi.create_ticket_entry ...'
196
+ end
197
+ # verify the required parameter 'client' is set
198
+ if @api_client.config.client_side_validation && client.nil?
199
+ fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.create_ticket_entry"
200
+ end
201
+ # verify the required parameter 'ticket_id' is set
202
+ if @api_client.config.client_side_validation && ticket_id.nil?
203
+ fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.create_ticket_entry"
204
+ end
205
+ # verify the required parameter 'body' is set
206
+ if @api_client.config.client_side_validation && body.nil?
207
+ fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.create_ticket_entry"
208
+ end
209
+ # resource path
210
+ local_var_path = '/{client}/tickets/{ticketId}/ticketEntries'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s))
211
+
212
+ # query parameters
213
+ query_params = opts[:query_params] || {}
214
+
215
+ # header parameters
216
+ header_params = opts[:header_params] || {}
217
+ # HTTP header 'Accept' (if needed)
218
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
219
+ # HTTP header 'Content-Type'
220
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
221
+
222
+ # form parameters
223
+ form_params = opts[:form_params] || {}
224
+
225
+ # http body (model)
226
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
227
+
228
+ # return_type
229
+ return_type = opts[:return_type] || 'ModelReference'
230
+
231
+ # auth_names
232
+ auth_names = opts[:auth_names] || []
233
+
234
+ new_options = opts.merge(
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => return_type
241
+ )
242
+
243
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: TicketsApi#create_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+
176
250
  # Deletes the owners image of the ticket.
177
251
  # @param client [String] Identification of executing client.
178
252
  # @param ticket_id [Integer] ID to identify the ticket.
@@ -221,7 +295,7 @@ module KoronaEntryClient
221
295
  return_type = opts[:return_type]
222
296
 
223
297
  # auth_names
224
- auth_names = opts[:auth_names] || ['basicAuth']
298
+ auth_names = opts[:auth_names] || []
225
299
 
226
300
  new_options = opts.merge(
227
301
  :header_params => header_params,
@@ -287,7 +361,7 @@ module KoronaEntryClient
287
361
  return_type = opts[:return_type]
288
362
 
289
363
  # auth_names
290
- auth_names = opts[:auth_names] || ['basicAuth']
364
+ auth_names = opts[:auth_names] || []
291
365
 
292
366
  new_options = opts.merge(
293
367
  :header_params => header_params,
@@ -305,6 +379,78 @@ module KoronaEntryClient
305
379
  return data, status_code, headers
306
380
  end
307
381
 
382
+ # Deletes the single ticket entry (marks it as used up).
383
+ # @param client [String] Identification of executing client.
384
+ # @param ticket_id [Integer] ID to identify the ticket.
385
+ # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket.
386
+ # @param [Hash] opts the optional parameters
387
+ # @return [nil]
388
+ def delete_ticket_entry(client, ticket_id, ticket_entry_id, opts = {})
389
+ delete_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts)
390
+ nil
391
+ end
392
+
393
+ # Deletes the single ticket entry (marks it as used up).
394
+ # @param client [String] Identification of executing client.
395
+ # @param ticket_id [Integer] ID to identify the ticket.
396
+ # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket.
397
+ # @param [Hash] opts the optional parameters
398
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
399
+ def delete_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts = {})
400
+ if @api_client.config.debugging
401
+ @api_client.config.logger.debug 'Calling API: TicketsApi.delete_ticket_entry ...'
402
+ end
403
+ # verify the required parameter 'client' is set
404
+ if @api_client.config.client_side_validation && client.nil?
405
+ fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.delete_ticket_entry"
406
+ end
407
+ # verify the required parameter 'ticket_id' is set
408
+ if @api_client.config.client_side_validation && ticket_id.nil?
409
+ fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.delete_ticket_entry"
410
+ end
411
+ # verify the required parameter 'ticket_entry_id' is set
412
+ if @api_client.config.client_side_validation && ticket_entry_id.nil?
413
+ fail ArgumentError, "Missing the required parameter 'ticket_entry_id' when calling TicketsApi.delete_ticket_entry"
414
+ end
415
+ # resource path
416
+ local_var_path = '/{client}/tickets/{ticketId}/ticketEntries/{ticketEntryId}'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)).sub('{' + 'ticketEntryId' + '}', CGI.escape(ticket_entry_id.to_s))
417
+
418
+ # query parameters
419
+ query_params = opts[:query_params] || {}
420
+
421
+ # header parameters
422
+ header_params = opts[:header_params] || {}
423
+ # HTTP header 'Accept' (if needed)
424
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
425
+
426
+ # form parameters
427
+ form_params = opts[:form_params] || {}
428
+
429
+ # http body (model)
430
+ post_body = opts[:body]
431
+
432
+ # return_type
433
+ return_type = opts[:return_type]
434
+
435
+ # auth_names
436
+ auth_names = opts[:auth_names] || []
437
+
438
+ new_options = opts.merge(
439
+ :header_params => header_params,
440
+ :query_params => query_params,
441
+ :form_params => form_params,
442
+ :body => post_body,
443
+ :auth_names => auth_names,
444
+ :return_type => return_type
445
+ )
446
+
447
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
448
+ if @api_client.config.debugging
449
+ @api_client.config.logger.debug "API called: TicketsApi#delete_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
450
+ end
451
+ return data, status_code, headers
452
+ end
453
+
308
454
  # Returns the owners image of the ticket
309
455
  # @param client [String] Identification of executing client.
310
456
  # @param ticket_id [Integer] ID to identify the ticket.
@@ -353,7 +499,7 @@ module KoronaEntryClient
353
499
  return_type = opts[:return_type] || 'TicketImage'
354
500
 
355
501
  # auth_names
356
- auth_names = opts[:auth_names] || ['basicAuth']
502
+ auth_names = opts[:auth_names] || []
357
503
 
358
504
  new_options = opts.merge(
359
505
  :header_params => header_params,
@@ -440,7 +586,7 @@ module KoronaEntryClient
440
586
  return_type = opts[:return_type] || 'TicketEntryLogList'
441
587
 
442
588
  # auth_names
443
- auth_names = opts[:auth_names] || ['basicAuth']
589
+ auth_names = opts[:auth_names] || []
444
590
 
445
591
  new_options = opts.merge(
446
592
  :header_params => header_params,
@@ -506,7 +652,7 @@ module KoronaEntryClient
506
652
  return_type = opts[:return_type] || 'Ticket'
507
653
 
508
654
  # auth_names
509
- auth_names = opts[:auth_names] || ['basicAuth']
655
+ auth_names = opts[:auth_names] || []
510
656
 
511
657
  new_options = opts.merge(
512
658
  :header_params => header_params,
@@ -578,7 +724,7 @@ module KoronaEntryClient
578
724
  return_type = opts[:return_type] || 'TicketEntry'
579
725
 
580
726
  # auth_names
581
- auth_names = opts[:auth_names] || ['basicAuth']
727
+ auth_names = opts[:auth_names] || []
582
728
 
583
729
  new_options = opts.merge(
584
730
  :header_params => header_params,
@@ -685,7 +831,7 @@ module KoronaEntryClient
685
831
  return_type = opts[:return_type] || 'TicketList'
686
832
 
687
833
  # auth_names
688
- auth_names = opts[:auth_names] || ['basicAuth']
834
+ auth_names = opts[:auth_names] || []
689
835
 
690
836
  new_options = opts.merge(
691
837
  :header_params => header_params,
@@ -759,7 +905,7 @@ module KoronaEntryClient
759
905
  return_type = opts[:return_type] || 'ModelReference'
760
906
 
761
907
  # auth_names
762
- auth_names = opts[:auth_names] || ['basicAuth']
908
+ auth_names = opts[:auth_names] || []
763
909
 
764
910
  new_options = opts.merge(
765
911
  :header_params => header_params,
@@ -833,7 +979,7 @@ module KoronaEntryClient
833
979
  return_type = opts[:return_type] || 'ModelReference'
834
980
 
835
981
  # auth_names
836
- auth_names = opts[:auth_names] || ['basicAuth']
982
+ auth_names = opts[:auth_names] || []
837
983
 
838
984
  new_options = opts.merge(
839
985
  :header_params => header_params,
@@ -850,5 +996,85 @@ module KoronaEntryClient
850
996
  end
851
997
  return data, status_code, headers
852
998
  end
999
+
1000
+ # Updates the single ticket entry.
1001
+ # @param client [String] Identification of executing client.
1002
+ # @param ticket_id [Integer] ID to identify the ticket.
1003
+ # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket.
1004
+ # @param body [TicketEntry] Properties to update of the ticket entry.
1005
+ # @param [Hash] opts the optional parameters
1006
+ # @return [ModelReference]
1007
+ def update_ticket_entry(client, ticket_id, ticket_entry_id, body, opts = {})
1008
+ data, _status_code, _headers = update_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, body, opts)
1009
+ data
1010
+ end
1011
+
1012
+ # Updates the single ticket entry.
1013
+ # @param client [String] Identification of executing client.
1014
+ # @param ticket_id [Integer] ID to identify the ticket.
1015
+ # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket.
1016
+ # @param body [TicketEntry] Properties to update of the ticket entry.
1017
+ # @param [Hash] opts the optional parameters
1018
+ # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers
1019
+ def update_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, body, opts = {})
1020
+ if @api_client.config.debugging
1021
+ @api_client.config.logger.debug 'Calling API: TicketsApi.update_ticket_entry ...'
1022
+ end
1023
+ # verify the required parameter 'client' is set
1024
+ if @api_client.config.client_side_validation && client.nil?
1025
+ fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.update_ticket_entry"
1026
+ end
1027
+ # verify the required parameter 'ticket_id' is set
1028
+ if @api_client.config.client_side_validation && ticket_id.nil?
1029
+ fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.update_ticket_entry"
1030
+ end
1031
+ # verify the required parameter 'ticket_entry_id' is set
1032
+ if @api_client.config.client_side_validation && ticket_entry_id.nil?
1033
+ fail ArgumentError, "Missing the required parameter 'ticket_entry_id' when calling TicketsApi.update_ticket_entry"
1034
+ end
1035
+ # verify the required parameter 'body' is set
1036
+ if @api_client.config.client_side_validation && body.nil?
1037
+ fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.update_ticket_entry"
1038
+ end
1039
+ # resource path
1040
+ local_var_path = '/{client}/tickets/{ticketId}/ticketEntries/{ticketEntryId}'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)).sub('{' + 'ticketEntryId' + '}', CGI.escape(ticket_entry_id.to_s))
1041
+
1042
+ # query parameters
1043
+ query_params = opts[:query_params] || {}
1044
+
1045
+ # header parameters
1046
+ header_params = opts[:header_params] || {}
1047
+ # HTTP header 'Accept' (if needed)
1048
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1049
+ # HTTP header 'Content-Type'
1050
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1051
+
1052
+ # form parameters
1053
+ form_params = opts[:form_params] || {}
1054
+
1055
+ # http body (model)
1056
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
1057
+
1058
+ # return_type
1059
+ return_type = opts[:return_type] || 'ModelReference'
1060
+
1061
+ # auth_names
1062
+ auth_names = opts[:auth_names] || []
1063
+
1064
+ new_options = opts.merge(
1065
+ :header_params => header_params,
1066
+ :query_params => query_params,
1067
+ :form_params => form_params,
1068
+ :body => post_body,
1069
+ :auth_names => auth_names,
1070
+ :return_type => return_type
1071
+ )
1072
+
1073
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1074
+ if @api_client.config.debugging
1075
+ @api_client.config.logger.debug "API called: TicketsApi#update_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1076
+ end
1077
+ return data, status_code, headers
1078
+ end
853
1079
  end
854
1080
  end