Class: PureCloud::WorkforceManagementApi

Inherits:
Object
  • Object
show all
Defined in:
lib/purecloud/api/workforce_management_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WorkforceManagementApi

Returns a new instance of WorkforceManagementApi.



23
24
25
# File 'lib/purecloud/api/workforce_management_api.rb', line 23

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



21
22
23
# File 'lib/purecloud/api/workforce_management_api.rb', line 21

def api_client
  @api_client
end

Instance Method Details

#get_adherence(user_id, opts = {}) ⇒ Array<UserScheduleAdherence>

Get a list of UserScheduleAdherence records for the requested users

Parameters:

  • user_id

    User Id(s) for which to fetch current schedule adherence information. Min 1, Max of 100 userIds per request

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

    the optional parameters

Returns:



32
33
34
35
# File 'lib/purecloud/api/workforce_management_api.rb', line 32

def get_adherence(user_id, opts = {})
  data, status_code, headers = get_adherence_with_http_info(user_id, opts)
  return data
end

#get_adherence_with_http_info(user_id, opts = {}) ⇒ Array<(Array<UserScheduleAdherence>, Fixnum, Hash)>

Get a list of UserScheduleAdherence records for the requested users

Parameters:

  • user_id

    User Id(s) for which to fetch current schedule adherence information. Min 1, Max of 100 userIds per request

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

    the optional parameters

Returns:

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

    Array<UserScheduleAdherence> data, response status code and response headers



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
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/purecloud/api/workforce_management_api.rb', line 42

def get_adherence_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_adherence ..."
  end
  
  # verify the required parameter 'user_id' is set
  fail "Missing the required parameter 'user_id' when calling get_adherence" if user_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/adherence".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'userId'] = @api_client.build_collection_param(user_id, :multi)

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'Array<UserScheduleAdherence>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_adherence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_decisions_downloads_download_id(download_id, opts = {}) ⇒ DecisionsDownloadLink

Get decisions download link

Parameters:

  • download_id

    The decisions file download id

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

    the optional parameters

Options Hash (opts):

  • :downloadfilename (String)

    The file name used to get the download url (default to downloadfilename)

Returns:



94
95
96
97
# File 'lib/purecloud/api/workforce_management_api.rb', line 94

def get_decisions_downloads_download_id(download_id, opts = {})
  data, status_code, headers = get_decisions_downloads_download_id_with_http_info(download_id, opts)
  return data
end

#get_decisions_downloads_download_id_with_http_info(download_id, opts = {}) ⇒ Array<(DecisionsDownloadLink, Fixnum, Hash)>

Get decisions download link

Parameters:

  • download_id

    The decisions file download id

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

    the optional parameters

Options Hash (opts):

  • :downloadfilename (String)

    The file name used to get the download url

Returns:

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

    DecisionsDownloadLink data, response status code and response headers



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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/purecloud/api/workforce_management_api.rb', line 105

def get_decisions_downloads_download_id_with_http_info(download_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_decisions_downloads_download_id ..."
  end
  
  # verify the required parameter 'download_id' is set
  fail "Missing the required parameter 'download_id' when calling get_decisions_downloads_download_id" if download_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/decisions/downloads/{downloadId}".sub('{format}','json').sub('{' + 'downloadId' + '}', download_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'downloadfilename'] = opts[:'downloadfilename'] if opts[:'downloadfilename']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'DecisionsDownloadLink')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_decisions_downloads_download_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_managementunits_mu_id_activitycodes(mu_id, opts = {}) ⇒ ActivityCodeContainer

Get activity codes corresponding to a management unit

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Returns:



156
157
158
159
# File 'lib/purecloud/api/workforce_management_api.rb', line 156

def get_managementunits_mu_id_activitycodes(mu_id, opts = {})
  data, status_code, headers = get_managementunits_mu_id_activitycodes_with_http_info(mu_id, opts)
  return data
end

#get_managementunits_mu_id_activitycodes_with_http_info(mu_id, opts = {}) ⇒ Array<(ActivityCodeContainer, Fixnum, Hash)>

Get activity codes corresponding to a management unit

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Returns:

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

    ActivityCodeContainer data, response status code and response headers



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/purecloud/api/workforce_management_api.rb', line 166

def get_managementunits_mu_id_activitycodes_with_http_info(mu_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_managementunits_mu_id_activitycodes ..."
  end
  
  # verify the required parameter 'mu_id' is set
  fail "Missing the required parameter 'mu_id' when calling get_managementunits_mu_id_activitycodes" if mu_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/managementunits/{muId}/activitycodes".sub('{format}','json').sub('{' + 'muId' + '}', mu_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'ActivityCodeContainer')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_managementunits_mu_id_activitycodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_managementunits_mu_id_users(mu_id, opts = {}) ⇒ WfmUserEntityListing

Get agents in the management unit

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Returns:



216
217
218
219
# File 'lib/purecloud/api/workforce_management_api.rb', line 216

def get_managementunits_mu_id_users(mu_id, opts = {})
  data, status_code, headers = get_managementunits_mu_id_users_with_http_info(mu_id, opts)
  return data
end

#get_managementunits_mu_id_users_user_id_timeoffrequests(mu_id, user_id, opts = {}) ⇒ TimeOffRequestList

Get a list of time off requests for any user

Parameters:

  • mu_id

    The muId of the management unit.

  • user_id

    The userId to whom the Time Off Request applies.

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

    the optional parameters

Options Hash (opts):

  • :recently_reviewed (BOOLEAN)

    Limit results to requests that have been reviewed within the preceding 30 days (default to false)

Returns:



278
279
280
281
# File 'lib/purecloud/api/workforce_management_api.rb', line 278

def get_managementunits_mu_id_users_user_id_timeoffrequests(mu_id, user_id, opts = {})
  data, status_code, headers = get_managementunits_mu_id_users_user_id_timeoffrequests_with_http_info(mu_id, user_id, opts)
  return data
end

#get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id(mu_id, user_id, time_off_request_id, opts = {}) ⇒ TimeOffRequest

Get a time off request by id

Parameters:

  • mu_id

    The muId of the management unit.

  • user_id

    The userId to whom the Time Off Request applies.

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Returns:



346
347
348
349
# File 'lib/purecloud/api/workforce_management_api.rb', line 346

def get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id(mu_id, user_id, time_off_request_id, opts = {})
  data, status_code, headers = get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id_with_http_info(mu_id, user_id, time_off_request_id, opts)
  return data
end

#get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id_with_http_info(mu_id, user_id, time_off_request_id, opts = {}) ⇒ Array<(TimeOffRequest, Fixnum, Hash)>

Get a time off request by id

Parameters:

  • mu_id

    The muId of the management unit.

  • user_id

    The userId to whom the Time Off Request applies.

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Returns:

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

    TimeOffRequest data, response status code and response headers



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/purecloud/api/workforce_management_api.rb', line 358

def get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id_with_http_info(mu_id, user_id, time_off_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id ..."
  end
  
  # verify the required parameter 'mu_id' is set
  fail "Missing the required parameter 'mu_id' when calling get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id" if mu_id.nil?
  
  # verify the required parameter 'user_id' is set
  fail "Missing the required parameter 'user_id' when calling get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id" if user_id.nil?
  
  # verify the required parameter 'time_off_request_id' is set
  fail "Missing the required parameter 'time_off_request_id' when calling get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id" if time_off_request_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests/{timeOffRequestId}".sub('{format}','json').sub('{' + 'muId' + '}', mu_id.to_s).sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'timeOffRequestId' + '}', time_off_request_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'TimeOffRequest')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_managementunits_mu_id_users_user_id_timeoffrequests_with_http_info(mu_id, user_id, opts = {}) ⇒ Array<(TimeOffRequestList, Fixnum, Hash)>

Get a list of time off requests for any user

Parameters:

  • mu_id

    The muId of the management unit.

  • user_id

    The userId to whom the Time Off Request applies.

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

    the optional parameters

Options Hash (opts):

  • :recently_reviewed (BOOLEAN)

    Limit results to requests that have been reviewed within the preceding 30 days

Returns:

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

    TimeOffRequestList data, response status code and response headers



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/purecloud/api/workforce_management_api.rb', line 290

def get_managementunits_mu_id_users_user_id_timeoffrequests_with_http_info(mu_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_managementunits_mu_id_users_user_id_timeoffrequests ..."
  end
  
  # verify the required parameter 'mu_id' is set
  fail "Missing the required parameter 'mu_id' when calling get_managementunits_mu_id_users_user_id_timeoffrequests" if mu_id.nil?
  
  # verify the required parameter 'user_id' is set
  fail "Missing the required parameter 'user_id' when calling get_managementunits_mu_id_users_user_id_timeoffrequests" if user_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests".sub('{format}','json').sub('{' + 'muId' + '}', mu_id.to_s).sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'recentlyReviewed'] = opts[:'recently_reviewed'] if opts[:'recently_reviewed']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'TimeOffRequestList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_managementunits_mu_id_users_user_id_timeoffrequests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_managementunits_mu_id_users_with_http_info(mu_id, opts = {}) ⇒ Array<(WfmUserEntityListing, Fixnum, Hash)>

Get agents in the management unit

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Returns:

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

    WfmUserEntityListing data, response status code and response headers



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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/purecloud/api/workforce_management_api.rb', line 226

def get_managementunits_mu_id_users_with_http_info(mu_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_managementunits_mu_id_users ..."
  end
  
  # verify the required parameter 'mu_id' is set
  fail "Missing the required parameter 'mu_id' when calling get_managementunits_mu_id_users" if mu_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/managementunits/{muId}/users".sub('{format}','json').sub('{' + 'muId' + '}', mu_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'WfmUserEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_managementunits_mu_id_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_timeoffrequests(opts = {}) ⇒ TimeOffRequestList

Get a list of time off requests for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :recently_reviewed (BOOLEAN)

    Limit results to requests that have been reviewed within the preceding 30 days (default to false)

Returns:



414
415
416
417
# File 'lib/purecloud/api/workforce_management_api.rb', line 414

def get_timeoffrequests(opts = {})
  data, status_code, headers = get_timeoffrequests_with_http_info(opts)
  return data
end

#get_timeoffrequests_timeoffrequest_id(time_off_request_id, opts = {}) ⇒ TimeOffRequest

Get a time off request for the current user by id

Parameters:

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Returns:



472
473
474
475
# File 'lib/purecloud/api/workforce_management_api.rb', line 472

def get_timeoffrequests_timeoffrequest_id(time_off_request_id, opts = {})
  data, status_code, headers = get_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts)
  return data
end

#get_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts = {}) ⇒ Array<(TimeOffRequest, Fixnum, Hash)>

Get a time off request for the current user by id

Parameters:

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Returns:

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

    TimeOffRequest data, response status code and response headers



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/purecloud/api/workforce_management_api.rb', line 482

def get_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_timeoffrequests_timeoffrequest_id ..."
  end
  
  # verify the required parameter 'time_off_request_id' is set
  fail "Missing the required parameter 'time_off_request_id' when calling get_timeoffrequests_timeoffrequest_id" if time_off_request_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId}".sub('{format}','json').sub('{' + 'timeOffRequestId' + '}', time_off_request_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'TimeOffRequest')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_timeoffrequests_timeoffrequest_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_timeoffrequests_with_http_info(opts = {}) ⇒ Array<(TimeOffRequestList, Fixnum, Hash)>

Get a list of time off requests for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :recently_reviewed (BOOLEAN)

    Limit results to requests that have been reviewed within the preceding 30 days

Returns:

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

    TimeOffRequestList data, response status code and response headers



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/purecloud/api/workforce_management_api.rb', line 424

def get_timeoffrequests_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_timeoffrequests ..."
  end
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/timeoffrequests".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'recentlyReviewed'] = opts[:'recently_reviewed'] if opts[:'recently_reviewed']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud Auth']
  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 => 'TimeOffRequestList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_timeoffrequests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_timeoffrequests_timeoffrequest_id(time_off_request_id, opts = {}) ⇒ nil

Mark a time off request for the current user as read or unread

Parameters:

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


533
534
535
536
# File 'lib/purecloud/api/workforce_management_api.rb', line 533

def patch_timeoffrequests_timeoffrequest_id(time_off_request_id, opts = {})
  patch_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts)
  return nil
end

#patch_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Mark a time off request for the current user as read or unread

Parameters:

  • time_off_request_id

    Time Off Request Id

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# File 'lib/purecloud/api/workforce_management_api.rb', line 544

def patch_timeoffrequests_timeoffrequest_id_with_http_info(time_off_request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#patch_timeoffrequests_timeoffrequest_id ..."
  end
  
  # verify the required parameter 'time_off_request_id' is set
  fail "Missing the required parameter 'time_off_request_id' when calling patch_timeoffrequests_timeoffrequest_id" if time_off_request_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId}".sub('{format}','json').sub('{' + 'timeOffRequestId' + '}', time_off_request_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#patch_timeoffrequests_timeoffrequest_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_decisions_downloads_search(body, opts = {}) ⇒ DecisionsFileMetadataEntityListing

Download decisions files metadata

Parameters:

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

    the optional parameters

Returns:



593
594
595
596
# File 'lib/purecloud/api/workforce_management_api.rb', line 593

def post_decisions_downloads_search(body, opts = {})
  data, status_code, headers = post_decisions_downloads_search_with_http_info(body, opts)
  return data
end

#post_decisions_downloads_search_with_http_info(body, opts = {}) ⇒ Array<(DecisionsFileMetadataEntityListing, Fixnum, Hash)>

Download decisions files metadata

Parameters:

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

    the optional parameters

Returns:



603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/purecloud/api/workforce_management_api.rb', line 603

def post_decisions_downloads_search_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_decisions_downloads_search ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_decisions_downloads_search" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/decisions/downloads/search".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DecisionsFileMetadataEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_decisions_downloads_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_longtermforecasts(body, opts = {}) ⇒ ForecastCreationCompletion

Create a forecast

Parameters:

  • body

    The request body

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

    the optional parameters

Returns:



653
654
655
656
# File 'lib/purecloud/api/workforce_management_api.rb', line 653

def post_longtermforecasts(body, opts = {})
  data, status_code, headers = post_longtermforecasts_with_http_info(body, opts)
  return data
end

#post_longtermforecasts_with_http_info(body, opts = {}) ⇒ Array<(ForecastCreationCompletion, Fixnum, Hash)>

Create a forecast

Parameters:

  • body

    The request body

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

    the optional parameters

Returns:

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

    ForecastCreationCompletion data, response status code and response headers



663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
# File 'lib/purecloud/api/workforce_management_api.rb', line 663

def post_longtermforecasts_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_longtermforecasts ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_longtermforecasts" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ForecastCreationCompletion')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_longtermforecasts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_managementunits_mu_id_schedules_search(mu_id, opts = {}) ⇒ UserScheduleContainer

Get user schedules within the given time range

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Options Hash (opts):

Returns:



714
715
716
717
# File 'lib/purecloud/api/workforce_management_api.rb', line 714

def post_managementunits_mu_id_schedules_search(mu_id, opts = {})
  data, status_code, headers = post_managementunits_mu_id_schedules_search_with_http_info(mu_id, opts)
  return data
end

#post_managementunits_mu_id_schedules_search_with_http_info(mu_id, opts = {}) ⇒ Array<(UserScheduleContainer, Fixnum, Hash)>

Get user schedules within the given time range

Parameters:

  • mu_id

    The muId of the management unit.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    UserScheduleContainer data, response status code and response headers



725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/purecloud/api/workforce_management_api.rb', line 725

def post_managementunits_mu_id_schedules_search_with_http_info(mu_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_managementunits_mu_id_schedules_search ..."
  end
  
  # verify the required parameter 'mu_id' is set
  fail "Missing the required parameter 'mu_id' when calling post_managementunits_mu_id_schedules_search" if mu_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/managementunits/{muId}/schedules/search".sub('{format}','json').sub('{' + 'muId' + '}', mu_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserScheduleContainer')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_managementunits_mu_id_schedules_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_schedules(opts = {}) ⇒ UserScheduleContainer

Get a schedule for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



775
776
777
778
# File 'lib/purecloud/api/workforce_management_api.rb', line 775

def post_schedules(opts = {})
  data, status_code, headers = post_schedules_with_http_info(opts)
  return data
end

#post_schedules_with_http_info(opts = {}) ⇒ Array<(UserScheduleContainer, Fixnum, Hash)>

Get a schedule for the current user

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    UserScheduleContainer data, response status code and response headers



785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
# File 'lib/purecloud/api/workforce_management_api.rb', line 785

def post_schedules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_schedules ..."
  end
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/schedules".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UserScheduleContainer')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end