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



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

#delete_longtermforecasts_forecast_id(forecast_id, opts = {}) ⇒ nil

Delete a forecast



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

def delete_longtermforecasts_forecast_id(forecast_id, opts = {})
  delete_longtermforecasts_forecast_id_with_http_info(forecast_id, opts)
  return nil
end

#delete_longtermforecasts_forecast_id_modifications_forecastmodification_id(forecast_id, forecast_modification_id, opts = {}) ⇒ nil

Delete a forecast modification



92
93
94
95
# File 'lib/purecloud/api/workforce_management_api.rb', line 92

def delete_longtermforecasts_forecast_id_modifications_forecastmodification_id(forecast_id, forecast_modification_id, opts = {})
  delete_longtermforecasts_forecast_id_modifications_forecastmodification_id_with_http_info(forecast_id, forecast_modification_id, opts)
  return nil
end

#delete_longtermforecasts_forecast_id_modifications_forecastmodification_id_with_http_info(forecast_id, forecast_modification_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a forecast modification



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

def delete_longtermforecasts_forecast_id_modifications_forecastmodification_id_with_http_info(forecast_id, forecast_modification_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#delete_longtermforecasts_forecast_id_modifications_forecastmodification_id ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling delete_longtermforecasts_forecast_id_modifications_forecastmodification_id" if forecast_id.nil?
  
  # verify the required parameter 'forecast_modification_id' is set
  fail "Missing the required parameter 'forecast_modification_id' when calling delete_longtermforecasts_forecast_id_modifications_forecastmodification_id" if forecast_modification_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}/modifications/{forecastModificationId}".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_id.to_s).sub('{' + 'forecastModificationId' + '}', forecast_modification_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(:DELETE, 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#delete_longtermforecasts_forecast_id_modifications_forecastmodification_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_longtermforecasts_forecast_id_with_http_info(forecast_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a forecast



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
# File 'lib/purecloud/api/workforce_management_api.rb', line 42

def delete_longtermforecasts_forecast_id_with_http_info(forecast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#delete_longtermforecasts_forecast_id ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling delete_longtermforecasts_forecast_id" if forecast_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_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(:DELETE, 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#delete_longtermforecasts_forecast_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get a list of UserScheduleAdherence records for the requested users



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

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<(UserScheduleAdherence, Fixnum, Hash)>

Get a list of UserScheduleAdherence records for the requested users



165
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 165

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 => '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_longtermforecasts_forecast_id(forecast_id, opts = {}) ⇒ Forecast

Get forecast



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

def get_longtermforecasts_forecast_id(forecast_id, opts = {})
  data, status_code, headers = get_longtermforecasts_forecast_id_with_http_info(forecast_id, opts)
  return data
end

#get_longtermforecasts_forecast_id_modifications(forecast_id, opts = {}) ⇒ Array<ForecastModification>

Get forecast Modifications



276
277
278
279
# File 'lib/purecloud/api/workforce_management_api.rb', line 276

def get_longtermforecasts_forecast_id_modifications(forecast_id, opts = {})
  data, status_code, headers = get_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, opts)
  return data
end

#get_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, opts = {}) ⇒ Array<(Array<ForecastModification>, Fixnum, Hash)>

Get forecast Modifications



286
287
288
289
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
# File 'lib/purecloud/api/workforce_management_api.rb', line 286

def get_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_longtermforecasts_forecast_id_modifications ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling get_longtermforecasts_forecast_id_modifications" if forecast_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}/modifications".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_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 => 'Array<ForecastModification>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_longtermforecasts_forecast_id_modifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longtermforecasts_forecast_id_with_http_info(forecast_id, opts = {}) ⇒ Array<(Forecast, Fixnum, Hash)>

Get forecast



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_longtermforecasts_forecast_id_with_http_info(forecast_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#get_longtermforecasts_forecast_id ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling get_longtermforecasts_forecast_id" if forecast_id.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_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 => 'Forecast')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#get_longtermforecasts_forecast_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create a forecast



336
337
338
339
# File 'lib/purecloud/api/workforce_management_api.rb', line 336

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

#post_longtermforecasts_forecast_id_modifications(forecast_id, body, opts = {}) ⇒ ForecastModificationCreation

Create a forecast modification



397
398
399
400
# File 'lib/purecloud/api/workforce_management_api.rb', line 397

def post_longtermforecasts_forecast_id_modifications(forecast_id, body, opts = {})
  data, status_code, headers = post_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts)
  return data
end

#post_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts = {}) ⇒ Array<(ForecastModificationCreation, Fixnum, Hash)>

Create a forecast modification



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
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
# File 'lib/purecloud/api/workforce_management_api.rb', line 408

def post_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_longtermforecasts_forecast_id_modifications ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling post_longtermforecasts_forecast_id_modifications" if forecast_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_longtermforecasts_forecast_id_modifications" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}/modifications".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_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(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 => 'ForecastModificationCreation')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_longtermforecasts_forecast_id_modifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_longtermforecasts_search(body, opts = {}) ⇒ ForecastMetadataEntityListing

Search forecasts



461
462
463
464
# File 'lib/purecloud/api/workforce_management_api.rb', line 461

def post_longtermforecasts_search(body, opts = {})
  data, status_code, headers = post_longtermforecasts_search_with_http_info(body, opts)
  return data
end

#post_longtermforecasts_search_with_http_info(body, opts = {}) ⇒ Array<(ForecastMetadataEntityListing, Fixnum, Hash)>

Search forecasts



471
472
473
474
475
476
477
478
479
480
481
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
# File 'lib/purecloud/api/workforce_management_api.rb', line 471

def post_longtermforecasts_search_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#post_longtermforecasts_search ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_longtermforecasts_search" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/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 => 'ForecastMetadataEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#post_longtermforecasts_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create a forecast



346
347
348
349
350
351
352
353
354
355
356
357
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
# File 'lib/purecloud/api/workforce_management_api.rb', line 346

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

#put_longtermforecasts_forecast_id_modifications(forecast_id, body, opts = {}) ⇒ ForecastModification

Update a forecast modification



522
523
524
525
# File 'lib/purecloud/api/workforce_management_api.rb', line 522

def put_longtermforecasts_forecast_id_modifications(forecast_id, body, opts = {})
  data, status_code, headers = put_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts)
  return data
end

#put_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts = {}) ⇒ Array<(ForecastModification, Fixnum, Hash)>

Update a forecast modification



533
534
535
536
537
538
539
540
541
542
543
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
# File 'lib/purecloud/api/workforce_management_api.rb', line 533

def put_longtermforecasts_forecast_id_modifications_with_http_info(forecast_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: WorkforceManagementApi#put_longtermforecasts_forecast_id_modifications ..."
  end
  
  # verify the required parameter 'forecast_id' is set
  fail "Missing the required parameter 'forecast_id' when calling put_longtermforecasts_forecast_id_modifications" if forecast_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling put_longtermforecasts_forecast_id_modifications" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/workforcemanagement/longtermforecasts/{forecastId}/modifications".sub('{format}','json').sub('{' + 'forecastId' + '}', forecast_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(body)
  
  auth_names = ['PureCloud Auth']
  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 => 'ForecastModification')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WorkforceManagementApi#put_longtermforecasts_forecast_id_modifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end