=begin #Tripletex API OpenAPI spec version: 2.69.5 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.24 =end require 'uri' module TripletexRubyClient class TokenemployeeApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create an employee token. Only selected consumers are allowed # # @param token_name A user defined name for the new token # @param consumer_name The name of the consumer # @param employee_id The id of the employee # @param company_owned Is the key company owned # @param expiration_date Expiration date for the employeeToken # @param [Hash] opts the optional parameters # @return [ResponseWrapperEmployeeToken] def create(token_name, consumer_name, employee_id, company_owned, expiration_date, opts = {}) data, _status_code, _headers = create_with_http_info(token_name, consumer_name, employee_id, company_owned, expiration_date, opts) data end # Create an employee token. Only selected consumers are allowed # # @param token_name A user defined name for the new token # @param consumer_name The name of the consumer # @param employee_id The id of the employee # @param company_owned Is the key company owned # @param expiration_date Expiration date for the employeeToken # @param [Hash] opts the optional parameters # @return [Array<(ResponseWrapperEmployeeToken, Fixnum, Hash)>] ResponseWrapperEmployeeToken data, response status code and response headers def create_with_http_info(token_name, consumer_name, employee_id, company_owned, expiration_date, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TokenemployeeApi.create ...' end # verify the required parameter 'token_name' is set if @api_client.config.client_side_validation && token_name.nil? fail ArgumentError, "Missing the required parameter 'token_name' when calling TokenemployeeApi.create" end # verify the required parameter 'consumer_name' is set if @api_client.config.client_side_validation && consumer_name.nil? fail ArgumentError, "Missing the required parameter 'consumer_name' when calling TokenemployeeApi.create" end # verify the required parameter 'employee_id' is set if @api_client.config.client_side_validation && employee_id.nil? fail ArgumentError, "Missing the required parameter 'employee_id' when calling TokenemployeeApi.create" end # verify the required parameter 'company_owned' is set if @api_client.config.client_side_validation && company_owned.nil? fail ArgumentError, "Missing the required parameter 'company_owned' when calling TokenemployeeApi.create" end # verify the required parameter 'expiration_date' is set if @api_client.config.client_side_validation && expiration_date.nil? fail ArgumentError, "Missing the required parameter 'expiration_date' when calling TokenemployeeApi.create" end # resource path local_var_path = '/token/employee/:create' # query parameters query_params = {} query_params[:'tokenName'] = token_name query_params[:'consumerName'] = consumer_name query_params[:'employeeId'] = employee_id query_params[:'companyOwned'] = company_owned query_params[:'expirationDate'] = expiration_date # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ResponseWrapperEmployeeToken') if @api_client.config.debugging @api_client.config.logger.debug "API called: TokenemployeeApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end