Class: TripletexRubyClient::TimesheetweekApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TimesheetweekApi

Returns a new instance of TimesheetweekApi.



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

def api_client
  @api_client
end

Instance Method Details

#approve(opts = {}) ⇒ ResponseWrapperWeek

Approve week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:



29
30
31
32
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 29

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

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

Approve week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:

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

    ResponseWrapperWeek data, response status code and response headers



41
42
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
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 41

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

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'weekYear'] = opts[:'week_year'] if !opts[:'week_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 => 'ResponseWrapperWeek')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetweekApi#approve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#complete(opts = {}) ⇒ ResponseWrapperWeek

Complete week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:



82
83
84
85
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 82

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

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

Complete week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:

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

    ResponseWrapperWeek data, response status code and response headers



94
95
96
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
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 94

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

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'weekYear'] = opts[:'week_year'] if !opts[:'week_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 => 'ResponseWrapperWeek')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetweekApi#complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reopen(opts = {}) ⇒ ResponseWrapperWeek

Reopen week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:



135
136
137
138
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 135

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

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

Reopen week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:

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

    ResponseWrapperWeek data, response status code and response headers



147
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
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 147

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

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'weekYear'] = opts[:'week_year'] if !opts[:'week_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 => 'ResponseWrapperWeek')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetweekApi#reopen\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search(opts = {}) ⇒ ListResponseWeek

Find weekly status By ID, week/year combination, employeeId. or an approver

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    List of IDs

  • :employee_ids (String)

    List of IDs

  • :week_year (String)

    ISO-8601 week-year

  • :approved_by (Integer)

    Equals

  • :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:



193
194
195
196
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 193

def search(opts = {})
  data, _status_code, _headers = search_with_http_info(opts)
  data
end

#search_with_http_info(opts = {}) ⇒ Array<(ListResponseWeek, Fixnum, Hash)>

Find weekly status By ID, week/year combination, employeeId. or an approver

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    List of IDs

  • :employee_ids (String)

    List of IDs

  • :week_year (String)

    ISO-8601 week-year

  • :approved_by (Integer)

    Equals

  • :from (Integer)

    From index

  • :count (Integer)

    Number of elements to return

  • :sorting (String)

    Sorting pattern

  • :fields (String)

    Fields filter pattern

Returns:

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

    ListResponseWeek data, response status code and response headers



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
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 210

def search_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TimesheetweekApi.search ...'
  end
  # resource path
  local_var_path = '/timesheet/week'

  # query parameters
  query_params = {}
  query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?
  query_params[:'employeeIds'] = opts[:'employee_ids'] if !opts[:'employee_ids'].nil?
  query_params[:'weekYear'] = opts[:'week_year'] if !opts[:'week_year'].nil?
  query_params[:'approvedBy'] = opts[:'approved_by'] if !opts[:'approved_by'].nil?
  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 => 'ListResponseWeek')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetweekApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unapprove(opts = {}) ⇒ ResponseWrapperWeek

Unapprove week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:



256
257
258
259
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 256

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

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

Unapprove week. By ID or (ISO-8601 week and employeeId combination).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :id (Integer)

    Equals

  • :employee_id (Integer)

    Equals

  • :week_year (String)

    ISO-8601 week-year

Returns:

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

    ResponseWrapperWeek data, response status code and response headers



268
269
270
271
272
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
# File 'lib/tripletex_ruby_client/api/timesheetweek_api.rb', line 268

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

  # query parameters
  query_params = {}
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'employeeId'] = opts[:'employee_id'] if !opts[:'employee_id'].nil?
  query_params[:'weekYear'] = opts[:'week_year'] if !opts[:'week_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 => 'ResponseWrapperWeek')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TimesheetweekApi#unapprove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end