Class: TripletexApi::TokenemployeeApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_api/api/tokenemployee_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TokenemployeeApi

Returns a new instance of TokenemployeeApi.



19
20
21
# File 'lib/tripletex_api/api/tokenemployee_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/tripletex_api/api/tokenemployee_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create(token_name, consumer_name, employee_id, company_owned, expiration_date, opts = {}) ⇒ ResponseWrapperEmployeeToken

Create an employee token. Only selected consumers are allowed

Parameters:

  • token_name

    A user defined name for the new token

  • consumer_name

    The name of the consumer

  • employee_id

    The id of the employee

  • company_owned

    Is the key company owned

  • expiration_date

    Expiration date for the employeeToken

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



32
33
34
35
# File 'lib/tripletex_api/api/tokenemployee_api.rb', line 32

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)
  return data
end

#create_with_http_info(token_name, consumer_name, employee_id, company_owned, expiration_date, opts = {}) ⇒ Array<(ResponseWrapperEmployeeToken, Fixnum, Hash)>

Create an employee token. Only selected consumers are allowed

Parameters:

  • token_name

    A user defined name for the new token

  • consumer_name

    The name of the consumer

  • employee_id

    The id of the employee

  • company_owned

    Is the key company owned

  • expiration_date

    Expiration date for the employeeToken

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/tripletex_api/api/tokenemployee_api.rb', line 46

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