Class: TripletexRubyClient::TimesheetmonthApi

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_ruby_client/api/timesheetmonth_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TimesheetmonthApi

Returns a new instance of TimesheetmonthApi.



19
20
21
# File 'lib/tripletex_ruby_client/api/timesheetmonth_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_ruby_client/api/timesheetmonth_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#approve(opts = {}) ⇒ ListResponseMonthlyStatus

approve month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

  • :approved_until_date (String)

    yyyy-MM-dd. Defaults to today.. Defaults to end of month

Returns:



30
31
32
33
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 30

def approve(opts = {})
  data, _status_code, _headers = approve_with_http_info(opts)
  data
end

#approve_with_http_info(opts = {}) ⇒ Array<(ListResponseMonthlyStatus, Fixnum, Hash)>

approve month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

  • :approved_until_date (String)

    yyyy-MM-dd. Defaults to today.. Defaults to end of month

Returns:

  • (Array<(ListResponseMonthlyStatus, Fixnum, Hash)>)

    ListResponseMonthlyStatus data, response status code and response headers



43
44
45
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
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 43

def approve_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.approve ...'
  end
  # resource path
  local_var_path = '/timesheet/month/:approve'

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeIds'] = opts[:'employee_ids'] if !opts[:'employee_ids'].nil?
  query_params[:'monthYear'] = opts[:'month_year'] if !opts[:'month_year'].nil?
  query_params[:'approvedUntilDate'] = opts[:'approved_until_date'] if !opts[:'approved_until_date'].nil?

  # 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 => 'ListResponseMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#approve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#complete(opts = {}) ⇒ ListResponseMonthlyStatus

complete month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:



85
86
87
88
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 85

def complete(opts = {})
  data, _status_code, _headers = complete_with_http_info(opts)
  data
end

#complete_with_http_info(opts = {}) ⇒ Array<(ListResponseMonthlyStatus, Fixnum, Hash)>

complete month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:

  • (Array<(ListResponseMonthlyStatus, Fixnum, Hash)>)

    ListResponseMonthlyStatus data, response status code and response headers



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 97

def complete_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.complete ...'
  end
  # resource path
  local_var_path = '/timesheet/month/:complete'

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeIds'] = opts[:'employee_ids'] if !opts[:'employee_ids'].nil?
  query_params[:'monthYear'] = opts[:'month_year'] if !opts[:'month_year'].nil?

  # 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 => 'ListResponseMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(id, opts = {}) ⇒ ResponseWrapperMonthlyStatus

Find monthly status entry by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



137
138
139
140
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 137

def get(id, opts = {})
  data, _status_code, _headers = get_with_http_info(id, opts)
  data
end

#get_by_month_number(employee_ids, month_year, opts = {}) ⇒ ListResponseMonthlyStatus

Find monthly status for given month.

Parameters:

  • employee_ids

    List of IDs. Defaults to ID of token owner.

  • month_year

    2020-01

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

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    From index (default to 0)

  • :count (Integer)

    Number of elements to return (default to 1000)

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:



194
195
196
197
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 194

def get_by_month_number(employee_ids, month_year, opts = {})
  data, _status_code, _headers = get_by_month_number_with_http_info(employee_ids, month_year, opts)
  data
end

#get_by_month_number_with_http_info(employee_ids, month_year, opts = {}) ⇒ Array<(ListResponseMonthlyStatus, Fixnum, Hash)>

Find monthly status for given month.

Parameters:

  • employee_ids

    List of IDs. Defaults to ID of token owner.

  • month_year

    2020-01

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

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

  • (Array<(ListResponseMonthlyStatus, Fixnum, Hash)>)

    ListResponseMonthlyStatus data, response status code and response headers



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 209

def get_by_month_number_with_http_info(employee_ids, month_year, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.get_by_month_number ...'
  end
  # verify the required parameter 'employee_ids' is set
  if @api_client.config.client_side_validation && employee_ids.nil?
    fail ArgumentError, "Missing the required parameter 'employee_ids' when calling TimesheetmonthApi.get_by_month_number"
  end
  # verify the required parameter 'month_year' is set
  if @api_client.config.client_side_validation && month_year.nil?
    fail ArgumentError, "Missing the required parameter 'month_year' when calling TimesheetmonthApi.get_by_month_number"
  end
  # resource path
  local_var_path = '/timesheet/month/byMonthNumber'

  # query parameters
  query_params = {}
  query_params[:'employeeIds'] = employee_ids
  query_params[:'monthYear'] = month_year
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # 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(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListResponseMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#get_by_month_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_with_http_info(id, opts = {}) ⇒ Array<(ResponseWrapperMonthlyStatus, Fixnum, Hash)>

Find monthly status entry by ID.

Parameters:

  • id

    Element ID

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    Fields filter pattern

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 148

def get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TimesheetmonthApi.get"
  end
  # resource path
  local_var_path = '/timesheet/month/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?

  # 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(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseWrapperMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reopen(opts = {}) ⇒ ListResponseMonthlyStatus

reopen month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:



261
262
263
264
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 261

def reopen(opts = {})
  data, _status_code, _headers = reopen_with_http_info(opts)
  data
end

#reopen_with_http_info(opts = {}) ⇒ Array<(ListResponseMonthlyStatus, Fixnum, Hash)>

reopen month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:

  • (Array<(ListResponseMonthlyStatus, Fixnum, Hash)>)

    ListResponseMonthlyStatus data, response status code and response headers



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 273

def reopen_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.reopen ...'
  end
  # resource path
  local_var_path = '/timesheet/month/:reopen'

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeIds'] = opts[:'employee_ids'] if !opts[:'employee_ids'].nil?
  query_params[:'monthYear'] = opts[:'month_year'] if !opts[:'month_year'].nil?

  # 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 => 'ListResponseMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#reopen\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unapprove(opts = {}) ⇒ ListResponseMonthlyStatus

unapprove month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:



314
315
316
317
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 314

def unapprove(opts = {})
  data, _status_code, _headers = unapprove_with_http_info(opts)
  data
end

#unapprove_with_http_info(opts = {}) ⇒ Array<(ListResponseMonthlyStatus, Fixnum, Hash)>

unapprove month(s). If id is provided the other args are ignored

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Element ID

  • :employee_ids (String)

    List of IDs. Defaults to ID of token owner.

  • :month_year (String)

    2020-01

Returns:

  • (Array<(ListResponseMonthlyStatus, Fixnum, Hash)>)

    ListResponseMonthlyStatus data, response status code and response headers



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/tripletex_ruby_client/api/timesheetmonth_api.rb', line 326

def unapprove_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetmonthApi.unapprove ...'
  end
  # resource path
  local_var_path = '/timesheet/month/:unapprove'

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeIds'] = opts[:'employee_ids'] if !opts[:'employee_ids'].nil?
  query_params[:'monthYear'] = opts[:'month_year'] if !opts[:'month_year'].nil?

  # 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 => 'ListResponseMonthlyStatus')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetmonthApi#unapprove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end