|
41 | 41 | from ..models import GetCelebrationListing |
42 | 42 | from ..models import Recognition |
43 | 43 | from ..models import RecognitionBase |
| 44 | +from ..models import Recognitions |
44 | 45 |
|
45 | 46 | class EmployeeEngagementApi(object): |
46 | 47 | """ |
@@ -292,6 +293,96 @@ def get_employeeengagement_recognition(self, recognition_id: str, **kwargs) -> ' |
292 | 293 | callback=params.get('callback')) |
293 | 294 | return response |
294 | 295 |
|
| 296 | + def get_employeeengagement_recognitions(self, **kwargs) -> 'Recognitions': |
| 297 | + """ |
| 298 | + Gets sent recognitions |
| 299 | + |
| 300 | +
|
| 301 | + This method makes a synchronous HTTP request by default. To make an |
| 302 | + asynchronous HTTP request, please define a `callback` function |
| 303 | + to be invoked when receiving the response. |
| 304 | + >>> def callback_function(response): |
| 305 | + >>> pprint(response) |
| 306 | + >>> |
| 307 | + >>> thread = api.get_employeeengagement_recognitions(callback=callback_function) |
| 308 | +
|
| 309 | + :param callback function: The callback function |
| 310 | + for asynchronous request. (optional) |
| 311 | + :param str direction: The direction of the recognitions. |
| 312 | + :param str recipient: The ID of the recipient (when direction is sent). |
| 313 | + :param datetime date_start: The start date of the search range. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z |
| 314 | + :param datetime date_end: The end date of the search range. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z |
| 315 | + :param int page_size: Page size |
| 316 | + :param int page_number: Page number |
| 317 | + :return: Recognitions |
| 318 | + If the method is called asynchronously, |
| 319 | + returns the request thread. |
| 320 | + """ |
| 321 | + |
| 322 | + all_params = ['direction', 'recipient', 'date_start', 'date_end', 'page_size', 'page_number'] |
| 323 | + all_params.append('callback') |
| 324 | + |
| 325 | + params = locals() |
| 326 | + for key, val in params['kwargs'].items(): |
| 327 | + if key not in all_params: |
| 328 | + raise TypeError( |
| 329 | + "Got an unexpected keyword argument '%s'" |
| 330 | + " to method get_employeeengagement_recognitions" % key |
| 331 | + ) |
| 332 | + params[key] = val |
| 333 | + del params['kwargs'] |
| 334 | + |
| 335 | + |
| 336 | + |
| 337 | + resource_path = '/api/v2/employeeengagement/recognitions'.replace('{format}', 'json') |
| 338 | + path_params = {} |
| 339 | + |
| 340 | + query_params = {} |
| 341 | + if 'direction' in params: |
| 342 | + query_params['direction'] = params['direction'] |
| 343 | + if 'recipient' in params: |
| 344 | + query_params['recipient'] = params['recipient'] |
| 345 | + if 'date_start' in params: |
| 346 | + query_params['dateStart'] = params['date_start'] |
| 347 | + if 'date_end' in params: |
| 348 | + query_params['dateEnd'] = params['date_end'] |
| 349 | + if 'page_size' in params: |
| 350 | + query_params['pageSize'] = params['page_size'] |
| 351 | + if 'page_number' in params: |
| 352 | + query_params['pageNumber'] = params['page_number'] |
| 353 | + |
| 354 | + header_params = {} |
| 355 | + |
| 356 | + form_params = [] |
| 357 | + local_var_files = {} |
| 358 | + |
| 359 | + body_params = None |
| 360 | + |
| 361 | + # HTTP header `Accept` |
| 362 | + header_params['Accept'] = self.api_client.\ |
| 363 | + select_header_accept(['application/json']) |
| 364 | + if not header_params['Accept']: |
| 365 | + del header_params['Accept'] |
| 366 | + |
| 367 | + # HTTP header `Content-Type` |
| 368 | + header_params['Content-Type'] = self.api_client.\ |
| 369 | + select_header_content_type(['application/json']) |
| 370 | + |
| 371 | + # Authentication setting |
| 372 | + auth_settings = ['PureCloud OAuth'] |
| 373 | + |
| 374 | + response = self.api_client.call_api(resource_path, 'GET', |
| 375 | + path_params, |
| 376 | + query_params, |
| 377 | + header_params, |
| 378 | + body=body_params, |
| 379 | + post_params=form_params, |
| 380 | + files=local_var_files, |
| 381 | + response_type='Recognitions', |
| 382 | + auth_settings=auth_settings, |
| 383 | + callback=params.get('callback')) |
| 384 | + return response |
| 385 | + |
295 | 386 | def patch_employeeengagement_celebration(self, celebration_id: str, body: 'CelebrationStateParam', **kwargs) -> None: |
296 | 387 | """ |
297 | 388 | Set a state for a celebration |
|
0 commit comments