Skip to content

Latest commit

 

History

History
548 lines (405 loc) · 15.2 KB

DepartmentApi.md

File metadata and controls

548 lines (405 loc) · 15.2 KB

TripletexRubyClient::DepartmentApi

All URIs are relative to https://tripletex.no/v2

Method HTTP request Description
delete DELETE /department/{id} Delete department by ID
get GET /department/{id} Get department by ID.
post POST /department [BETA] Add new department.
post_list POST /department/list [BETA] Register new departments.
put PUT /department/{id} [BETA] Update department.
put_list PUT /department/list [BETA] Update multiple departments.
query GET /department/query [BETA] Wildcard search.
search GET /department Find department corresponding with sent data.

delete

delete(id)

Delete department by ID

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

id = 56 # Integer | Element ID


begin
  #Delete department by ID
  api_instance.delete(id)
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->delete: #{e}"
end

Parameters

Name Type Description Notes
id Integer Element ID

Return type

nil (empty response body)

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

get

ResponseWrapperDepartment get(id, opts)

Get department by ID.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

id = 56 # Integer | Element ID

opts = { 
  fields: 'fields_example' # String | Fields filter pattern
}

begin
  #Get department by ID.
  result = api_instance.get(id, opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->get: #{e}"
end

Parameters

Name Type Description Notes
id Integer Element ID
fields String Fields filter pattern [optional]

Return type

ResponseWrapperDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

post

ResponseWrapperDepartment post(opts)

[BETA] Add new department.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

opts = { 
  body: TripletexRubyClient::Department.new # Department | JSON representing the new object to be created. Should not have ID and version set.
}

begin
  #[BETA] Add new department.
  result = api_instance.post(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->post: #{e}"
end

Parameters

Name Type Description Notes
body Department JSON representing the new object to be created. Should not have ID and version set. [optional]

Return type

ResponseWrapperDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

post_list

ListResponseDepartment post_list(opts)

[BETA] Register new departments.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

opts = { 
  body: [TripletexRubyClient::Department.new] # Array<Department> | JSON representing a list of new object to be created. Should not have ID and version set.
}

begin
  #[BETA] Register new departments.
  result = api_instance.post_list(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->post_list: #{e}"
end

Parameters

Name Type Description Notes
body Array<Department> JSON representing a list of new object to be created. Should not have ID and version set. [optional]

Return type

ListResponseDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

put

ResponseWrapperDepartment put(id, opts)

[BETA] Update department.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

id = 56 # Integer | Element ID

opts = { 
  body: TripletexRubyClient::Department.new # Department | Partial object describing what should be updated
}

begin
  #[BETA] Update department.
  result = api_instance.put(id, opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->put: #{e}"
end

Parameters

Name Type Description Notes
id Integer Element ID
body Department Partial object describing what should be updated [optional]

Return type

ResponseWrapperDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

put_list

ListResponseDepartment put_list(opts)

[BETA] Update multiple departments.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

opts = { 
  body: [TripletexRubyClient::Department.new] # Array<Department> | JSON representing updates to object. Should have ID and version set.
}

begin
  #[BETA] Update multiple departments.
  result = api_instance.put_list(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->put_list: #{e}"
end

Parameters

Name Type Description Notes
body Array<Department> JSON representing updates to object. Should have ID and version set. [optional]

Return type

ListResponseDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: Not defined

query

ListResponseDepartment query(opts)

[BETA] Wildcard search.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

opts = { 
  query: 'query_example', # String | Containing
  count: 25, # Integer | Number of elements to return
  fields: 'id, name', # String | Fields filter pattern
  from: 0, # Integer | From index
  sorting: 'sorting_example' # String | Sorting pattern
}

begin
  #[BETA] Wildcard search.
  result = api_instance.query(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->query: #{e}"
end

Parameters

Name Type Description Notes
query String Containing [optional]
count Integer Number of elements to return [optional] [default to 25]
fields String Fields filter pattern [optional] [default to id, name]
from Integer From index [optional] [default to 0]
sorting String Sorting pattern [optional]

Return type

ListResponseDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

search

ListResponseDepartment search(opts)

Find department corresponding with sent data.

Example

# load the gem
require 'tripletex_ruby_client'
# setup authorization
# # Setup authorization - as autogenerated by swagger-codegen
# TripletexRubyClient.configure do |config|
#   # Configure HTTP basic authorization: tokenAuthScheme
#   config.username = 'YOUR USERNAME'
#   config.password = 'YOUR PASSWORD'
# end
# Setup authorization
# 
TripletexRubyClient.configure do |config|
  # Configure HTTP basic authorization: tokenAuthScheme
  config.consumer_token = ENV["TT_CONSUMER_TOKEN"]
  config.employee_token = ENV["TT_EMPLOYEE_TOKEN"]
  config.host = Rails.env.production? ? 'https://tripletex.no' : 'https://api.tripletex.io'
  config.token_expiration_time = Rails.env.production? ? 1.month : 1.day
end
api_instance = TripletexRubyClient::DepartmentApi.new

opts = { 
  id: 'id_example', # String | List of IDs
  name: 'name_example', # String | Containing
  department_number: 'department_number_example', # String | Containing
  department_manager_id: 'department_manager_id_example', # String | List of IDs
  is_inactive: true, # BOOLEAN | true - return only inactive departments; false - return only active departments; unspecified - return both types
  from: 0, # Integer | From index
  count: 1000, # Integer | Number of elements to return
  sorting: 'sorting_example', # String | Sorting pattern
  fields: 'fields_example' # String | Fields filter pattern
}

begin
  #Find department corresponding with sent data.
  result = api_instance.search(opts)
  p result
rescue TripletexRubyClient::ApiError => e
  puts "Exception when calling DepartmentApi->search: #{e}"
end

Parameters

Name Type Description Notes
id String List of IDs [optional]
name String Containing [optional]
department_number String Containing [optional]
department_manager_id String List of IDs [optional]
is_inactive BOOLEAN true - return only inactive departments; false - return only active departments; unspecified - return both types [optional]
from Integer From index [optional] [default to 0]
count Integer Number of elements to return [optional] [default to 1000]
sorting String Sorting pattern [optional]
fields String Fields filter pattern [optional]

Return type

ListResponseDepartment

Authorization

tokenAuthScheme

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined