=begin #KORONA.entry API v1 #Our api provides access to our entry services The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.0 =end require 'cgi' module KoronaEntryClient class TicketsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Checks a ticket. The entry can optionally also be committed. # @param client [String] Identification of executing client. # @param ticket_number [String] Ticket number to be checked. # @param [Hash] opts the optional parameters # @option opts [Boolean] :commit_entry True if entry should be committed. # @option opts [String] :commit_type # @option opts [String] :organizational_unit_number Number of organizational unit. # @option opts [DateTime] :time The time to be checked. *Now* if not specified further. # @option opts [Integer] :number_of_uses Number of uses. *1* if not specified further. # @return [EntryResponse] def check_ticket(client, ticket_number, opts = {}) data, _status_code, _headers = check_ticket_with_http_info(client, ticket_number, opts) data end # Checks a ticket. The entry can optionally also be committed. # @param client [String] Identification of executing client. # @param ticket_number [String] Ticket number to be checked. # @param [Hash] opts the optional parameters # @option opts [Boolean] :commit_entry True if entry should be committed. # @option opts [String] :commit_type # @option opts [String] :organizational_unit_number Number of organizational unit. # @option opts [DateTime] :time The time to be checked. *Now* if not specified further. # @option opts [Integer] :number_of_uses Number of uses. *1* if not specified further. # @return [Array<(EntryResponse, Integer, Hash)>] EntryResponse data, response status code and response headers def check_ticket_with_http_info(client, ticket_number, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.check_ticket ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.check_ticket" end # verify the required parameter 'ticket_number' is set if @api_client.config.client_side_validation && ticket_number.nil? fail ArgumentError, "Missing the required parameter 'ticket_number' when calling TicketsApi.check_ticket" end allowable_values = ["ACCESS", "EXIT"] if @api_client.config.client_side_validation && opts[:'commit_type'] && !allowable_values.include?(opts[:'commit_type']) fail ArgumentError, "invalid value for \"commit_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/{client}/checkTicket'.sub('{' + 'client' + '}', CGI.escape(client.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'ticketNumber'] = ticket_number query_params[:'commitEntry'] = opts[:'commit_entry'] if !opts[:'commit_entry'].nil? query_params[:'commitType'] = opts[:'commit_type'] if !opts[:'commit_type'].nil? query_params[:'organizationalUnitNumber'] = opts[:'organizational_unit_number'] if !opts[:'organizational_unit_number'].nil? query_params[:'time'] = opts[:'time'] if !opts[:'time'].nil? query_params[:'numberOfUses'] = opts[:'number_of_uses'] if !opts[:'number_of_uses'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'EntryResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#check_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new ticket. # @param client [String] Identification of executing client. # @param body [Ticket] Properties to update of the ticket. # @param [Hash] opts the optional parameters # @return [ModelReference] def create_ticket(client, body, opts = {}) data, _status_code, _headers = create_ticket_with_http_info(client, body, opts) data end # Creates a new ticket. # @param client [String] Identification of executing client. # @param body [Ticket] Properties to update of the ticket. # @param [Hash] opts the optional parameters # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers def create_ticket_with_http_info(client, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.create_ticket ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.create_ticket" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.create_ticket" end # resource path local_var_path = '/{client}/tickets'.sub('{' + 'client' + '}', CGI.escape(client.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'ModelReference' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#create_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new ticket entry for a specific ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [TicketEntry] Properties to update of the ticket entry. # @param [Hash] opts the optional parameters # @return [ModelReference] def create_ticket_entry(client, ticket_id, body, opts = {}) data, _status_code, _headers = create_ticket_entry_with_http_info(client, ticket_id, body, opts) data end # Creates a new ticket entry for a specific ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [TicketEntry] Properties to update of the ticket entry. # @param [Hash] opts the optional parameters # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers def create_ticket_entry_with_http_info(client, ticket_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.create_ticket_entry ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.create_ticket_entry" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.create_ticket_entry" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.create_ticket_entry" end # resource path local_var_path = '/{client}/tickets/{ticketId}/ticketEntries'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'ModelReference' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#create_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the owners image of the ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [nil] def delete_image(client, ticket_id, opts = {}) delete_image_with_http_info(client, ticket_id, opts) nil end # Deletes the owners image of the ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_image_with_http_info(client, ticket_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.delete_image ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.delete_image" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.delete_image" end # resource path local_var_path = '/{client}/tickets/{ticketId}/image'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#delete_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [nil] def delete_ticket(client, ticket_id, opts = {}) delete_ticket_with_http_info(client, ticket_id, opts) nil end # Deletes the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_ticket_with_http_info(client, ticket_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.delete_ticket ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.delete_ticket" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.delete_ticket" end # resource path local_var_path = '/{client}/tickets/{ticketId}'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#delete_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes the single ticket entry (marks it as used up). # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param [Hash] opts the optional parameters # @return [nil] def delete_ticket_entry(client, ticket_id, ticket_entry_id, opts = {}) delete_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts) nil end # Deletes the single ticket entry (marks it as used up). # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.delete_ticket_entry ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.delete_ticket_entry" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.delete_ticket_entry" end # verify the required parameter 'ticket_entry_id' is set if @api_client.config.client_side_validation && ticket_entry_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_entry_id' when calling TicketsApi.delete_ticket_entry" end # resource path 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)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#delete_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the owners image of the ticket # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [TicketImage] def get_image(client, ticket_id, opts = {}) data, _status_code, _headers = get_image_with_http_info(client, ticket_id, opts) data end # Returns the owners image of the ticket # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [Array<(TicketImage, Integer, Hash)>] TicketImage data, response status code and response headers def get_image_with_http_info(client, ticket_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.get_image ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.get_image" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.get_image" end # resource path local_var_path = '/{client}/tickets/{ticketId}/image'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TicketImage' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#get_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the log for a optional single ticket and/or organizational unit # @param client [String] Identification of executing client. # @param time_from [DateTime] Log time from. # @param time_to [DateTime] Log time to. # @param log_types [Array] Restrict the logs to specific log events. # @param [Hash] opts the optional parameters # @option opts [String] :ticket_number Optional filter to restrict the logs to actions to the specified ticket. # @option opts [String] :organizational_unit_number Optional filter to restrict the logs to actions within the specified organizational unit. # @return [TicketEntryLogList] def get_logs(client, time_from, time_to, log_types, opts = {}) data, _status_code, _headers = get_logs_with_http_info(client, time_from, time_to, log_types, opts) data end # Returns the log for a optional single ticket and/or organizational unit # @param client [String] Identification of executing client. # @param time_from [DateTime] Log time from. # @param time_to [DateTime] Log time to. # @param log_types [Array] Restrict the logs to specific log events. # @param [Hash] opts the optional parameters # @option opts [String] :ticket_number Optional filter to restrict the logs to actions to the specified ticket. # @option opts [String] :organizational_unit_number Optional filter to restrict the logs to actions within the specified organizational unit. # @return [Array<(TicketEntryLogList, Integer, Hash)>] TicketEntryLogList data, response status code and response headers def get_logs_with_http_info(client, time_from, time_to, log_types, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.get_logs ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.get_logs" end # verify the required parameter 'time_from' is set if @api_client.config.client_side_validation && time_from.nil? fail ArgumentError, "Missing the required parameter 'time_from' when calling TicketsApi.get_logs" end # verify the required parameter 'time_to' is set if @api_client.config.client_side_validation && time_to.nil? fail ArgumentError, "Missing the required parameter 'time_to' when calling TicketsApi.get_logs" end # verify the required parameter 'log_types' is set if @api_client.config.client_side_validation && log_types.nil? fail ArgumentError, "Missing the required parameter 'log_types' when calling TicketsApi.get_logs" end # resource path local_var_path = '/{client}/ticketEntryLogs'.sub('{' + 'client' + '}', CGI.escape(client.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'timeFrom'] = time_from query_params[:'timeTo'] = time_to query_params[:'logTypes'] = @api_client.build_collection_param(log_types, :multi) query_params[:'ticketNumber'] = opts[:'ticket_number'] if !opts[:'ticket_number'].nil? query_params[:'organizationalUnitNumber'] = opts[:'organizational_unit_number'] if !opts[:'organizational_unit_number'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TicketEntryLogList' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#get_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [Ticket] def get_ticket(client, ticket_id, opts = {}) data, _status_code, _headers = get_ticket_with_http_info(client, ticket_id, opts) data end # Returns the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param [Hash] opts the optional parameters # @return [Array<(Ticket, Integer, Hash)>] Ticket data, response status code and response headers def get_ticket_with_http_info(client, ticket_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.get_ticket ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.get_ticket" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.get_ticket" end # resource path local_var_path = '/{client}/tickets/{ticketId}'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Ticket' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#get_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns a single ticket entry. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param [Hash] opts the optional parameters # @return [TicketEntry] def get_ticket_entry(client, ticket_id, ticket_entry_id, opts = {}) data, _status_code, _headers = get_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts) data end # Returns a single ticket entry. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param [Hash] opts the optional parameters # @return [Array<(TicketEntry, Integer, Hash)>] TicketEntry data, response status code and response headers def get_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.get_ticket_entry ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.get_ticket_entry" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.get_ticket_entry" end # verify the required parameter 'ticket_entry_id' is set if @api_client.config.client_side_validation && ticket_entry_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_entry_id' when calling TicketsApi.get_ticket_entry" end # resource path 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)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TicketEntry' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#get_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists all tickets. # @param client [String] Identification of executing client. # @param offset [Integer] Position in the dataset to start to retrieve. # @param page_size [Integer] Amount of objects to return per page. # @param [Hash] opts the optional parameters # @option opts [String] :ticket_number Restrict the list for a specific ticket number # @option opts [DateTime] :create_date_from Restrict the list for begin of creation date. # @option opts [DateTime] :create_date_to Restrict the list for end of creation date. # @option opts [DateTime] :deactivation_date_from Restrict the list for start of deactivation date. # @option opts [DateTime] :deactivation_date_to Restrict the list for end of deactivation date. # @option opts [Boolean] :locked Restrict the list for locked tickets. # @option opts [DateTime] :locked_to_date_from Restrict the list for for locked tickets. # @option opts [DateTime] :locked_to_date_to Restrict the list for for locked tickets. # @option opts [String] :personalization_customer_number Restrict the list for tickets owned by customers with specific customer number. # @option opts [String] :personalization_lastname Restrict the list for tickets owned by customers with specific last name. # @option opts [String] :personalization_firstname Restrict the list for tickets owned by customers with specific first name. # @return [TicketList] def get_tickets(client, offset, page_size, opts = {}) data, _status_code, _headers = get_tickets_with_http_info(client, offset, page_size, opts) data end # Lists all tickets. # @param client [String] Identification of executing client. # @param offset [Integer] Position in the dataset to start to retrieve. # @param page_size [Integer] Amount of objects to return per page. # @param [Hash] opts the optional parameters # @option opts [String] :ticket_number Restrict the list for a specific ticket number # @option opts [DateTime] :create_date_from Restrict the list for begin of creation date. # @option opts [DateTime] :create_date_to Restrict the list for end of creation date. # @option opts [DateTime] :deactivation_date_from Restrict the list for start of deactivation date. # @option opts [DateTime] :deactivation_date_to Restrict the list for end of deactivation date. # @option opts [Boolean] :locked Restrict the list for locked tickets. # @option opts [DateTime] :locked_to_date_from Restrict the list for for locked tickets. # @option opts [DateTime] :locked_to_date_to Restrict the list for for locked tickets. # @option opts [String] :personalization_customer_number Restrict the list for tickets owned by customers with specific customer number. # @option opts [String] :personalization_lastname Restrict the list for tickets owned by customers with specific last name. # @option opts [String] :personalization_firstname Restrict the list for tickets owned by customers with specific first name. # @return [Array<(TicketList, Integer, Hash)>] TicketList data, response status code and response headers def get_tickets_with_http_info(client, offset, page_size, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.get_tickets ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.get_tickets" end # verify the required parameter 'offset' is set if @api_client.config.client_side_validation && offset.nil? fail ArgumentError, "Missing the required parameter 'offset' when calling TicketsApi.get_tickets" end # verify the required parameter 'page_size' is set if @api_client.config.client_side_validation && page_size.nil? fail ArgumentError, "Missing the required parameter 'page_size' when calling TicketsApi.get_tickets" end # resource path local_var_path = '/{client}/tickets'.sub('{' + 'client' + '}', CGI.escape(client.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'offset'] = offset query_params[:'pageSize'] = page_size query_params[:'ticketNumber'] = opts[:'ticket_number'] if !opts[:'ticket_number'].nil? query_params[:'createDateFrom'] = opts[:'create_date_from'] if !opts[:'create_date_from'].nil? query_params[:'createDateTo'] = opts[:'create_date_to'] if !opts[:'create_date_to'].nil? query_params[:'deactivationDateFrom'] = opts[:'deactivation_date_from'] if !opts[:'deactivation_date_from'].nil? query_params[:'deactivationDateTo'] = opts[:'deactivation_date_to'] if !opts[:'deactivation_date_to'].nil? query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil? query_params[:'lockedToDateFrom'] = opts[:'locked_to_date_from'] if !opts[:'locked_to_date_from'].nil? query_params[:'lockedToDateTo'] = opts[:'locked_to_date_to'] if !opts[:'locked_to_date_to'].nil? query_params[:'personalizationCustomerNumber'] = opts[:'personalization_customer_number'] if !opts[:'personalization_customer_number'].nil? query_params[:'personalizationLastname'] = opts[:'personalization_lastname'] if !opts[:'personalization_lastname'].nil? query_params[:'personalizationFirstname'] = opts[:'personalization_firstname'] if !opts[:'personalization_firstname'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'TicketList' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#get_tickets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the owners image of the ticket # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [TicketImage] Properties to update of the image. # @param [Hash] opts the optional parameters # @return [ModelReference] def update_image(client, ticket_id, body, opts = {}) data, _status_code, _headers = update_image_with_http_info(client, ticket_id, body, opts) data end # Updates the owners image of the ticket # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [TicketImage] Properties to update of the image. # @param [Hash] opts the optional parameters # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers def update_image_with_http_info(client, ticket_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.update_image ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.update_image" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.update_image" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.update_image" end # resource path local_var_path = '/{client}/tickets/{ticketId}/image'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'ModelReference' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#update_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [Ticket] Properties to update of the ticket. # @param [Hash] opts the optional parameters # @return [ModelReference] def update_ticket(client, ticket_id, body, opts = {}) data, _status_code, _headers = update_ticket_with_http_info(client, ticket_id, body, opts) data end # Updates the single ticket. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param body [Ticket] Properties to update of the ticket. # @param [Hash] opts the optional parameters # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers def update_ticket_with_http_info(client, ticket_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.update_ticket ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.update_ticket" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.update_ticket" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.update_ticket" end # resource path local_var_path = '/{client}/tickets/{ticketId}'.sub('{' + 'client' + '}', CGI.escape(client.to_s)).sub('{' + 'ticketId' + '}', CGI.escape(ticket_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'ModelReference' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#update_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates the single ticket entry. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param body [TicketEntry] Properties to update of the ticket entry. # @param [Hash] opts the optional parameters # @return [ModelReference] def update_ticket_entry(client, ticket_id, ticket_entry_id, body, opts = {}) data, _status_code, _headers = update_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, body, opts) data end # Updates the single ticket entry. # @param client [String] Identification of executing client. # @param ticket_id [Integer] ID to identify the ticket. # @param ticket_entry_id [Integer] ID to identify the ticket entry of the ticket. # @param body [TicketEntry] Properties to update of the ticket entry. # @param [Hash] opts the optional parameters # @return [Array<(ModelReference, Integer, Hash)>] ModelReference data, response status code and response headers def update_ticket_entry_with_http_info(client, ticket_id, ticket_entry_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TicketsApi.update_ticket_entry ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling TicketsApi.update_ticket_entry" end # verify the required parameter 'ticket_id' is set if @api_client.config.client_side_validation && ticket_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_id' when calling TicketsApi.update_ticket_entry" end # verify the required parameter 'ticket_entry_id' is set if @api_client.config.client_side_validation && ticket_entry_id.nil? fail ArgumentError, "Missing the required parameter 'ticket_entry_id' when calling TicketsApi.update_ticket_entry" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling TicketsApi.update_ticket_entry" end # resource path 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)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'ModelReference' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TicketsApi#update_ticket_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end