|
46 | 46 | from ..models import GuideVersion |
47 | 47 | from ..models import GuideVersionPublishJob |
48 | 48 | from ..models import GuideVersionPublishJobRequest |
| 49 | +from ..models import UpdateGuide |
49 | 50 | from ..models import UpdateGuideVersion |
50 | 51 |
|
51 | 52 | class AIStudioApi(object): |
@@ -656,6 +657,91 @@ def get_guides_job(self, job_id: str, **kwargs) -> 'GuideContentGenerationJob': |
656 | 657 | callback=params.get('callback')) |
657 | 658 | return response |
658 | 659 |
|
| 660 | + def patch_guide(self, guide_id: str, body: 'UpdateGuide', **kwargs) -> 'Guide': |
| 661 | + """ |
| 662 | + Update a guide. |
| 663 | + |
| 664 | + patch_guide is a preview method and is subject to both breaking and non-breaking changes at any time without notice |
| 665 | +
|
| 666 | + This method makes a synchronous HTTP request by default. To make an |
| 667 | + asynchronous HTTP request, please define a `callback` function |
| 668 | + to be invoked when receiving the response. |
| 669 | + >>> def callback_function(response): |
| 670 | + >>> pprint(response) |
| 671 | + >>> |
| 672 | + >>> thread = api.patch_guide(guide_id, body, callback=callback_function) |
| 673 | +
|
| 674 | + :param callback function: The callback function |
| 675 | + for asynchronous request. (optional) |
| 676 | + :param str guide_id: Guide ID (required) |
| 677 | + :param UpdateGuide body: (required) |
| 678 | + :return: Guide |
| 679 | + If the method is called asynchronously, |
| 680 | + returns the request thread. |
| 681 | + """ |
| 682 | + |
| 683 | + all_params = ['guide_id', 'body'] |
| 684 | + all_params.append('callback') |
| 685 | + |
| 686 | + params = locals() |
| 687 | + for key, val in params['kwargs'].items(): |
| 688 | + if key not in all_params: |
| 689 | + raise TypeError( |
| 690 | + "Got an unexpected keyword argument '%s'" |
| 691 | + " to method patch_guide" % key |
| 692 | + ) |
| 693 | + params[key] = val |
| 694 | + del params['kwargs'] |
| 695 | + |
| 696 | + # verify the required parameter 'guide_id' is set |
| 697 | + if ('guide_id' not in params) or (params['guide_id'] is None): |
| 698 | + raise ValueError("Missing the required parameter `guide_id` when calling `patch_guide`") |
| 699 | + # verify the required parameter 'body' is set |
| 700 | + if ('body' not in params) or (params['body'] is None): |
| 701 | + raise ValueError("Missing the required parameter `body` when calling `patch_guide`") |
| 702 | + |
| 703 | + |
| 704 | + resource_path = '/api/v2/guides/{guideId}'.replace('{format}', 'json') |
| 705 | + path_params = {} |
| 706 | + if 'guide_id' in params: |
| 707 | + path_params['guideId'] = params['guide_id'] |
| 708 | + |
| 709 | + query_params = {} |
| 710 | + |
| 711 | + header_params = {} |
| 712 | + |
| 713 | + form_params = [] |
| 714 | + local_var_files = {} |
| 715 | + |
| 716 | + body_params = None |
| 717 | + if 'body' in params: |
| 718 | + body_params = params['body'] |
| 719 | + |
| 720 | + # HTTP header `Accept` |
| 721 | + header_params['Accept'] = self.api_client.\ |
| 722 | + select_header_accept(['application/json']) |
| 723 | + if not header_params['Accept']: |
| 724 | + del header_params['Accept'] |
| 725 | + |
| 726 | + # HTTP header `Content-Type` |
| 727 | + header_params['Content-Type'] = self.api_client.\ |
| 728 | + select_header_content_type(['application/json']) |
| 729 | + |
| 730 | + # Authentication setting |
| 731 | + auth_settings = ['PureCloud OAuth'] |
| 732 | + |
| 733 | + response = self.api_client.call_api(resource_path, 'PATCH', |
| 734 | + path_params, |
| 735 | + query_params, |
| 736 | + header_params, |
| 737 | + body=body_params, |
| 738 | + post_params=form_params, |
| 739 | + files=local_var_files, |
| 740 | + response_type='Guide', |
| 741 | + auth_settings=auth_settings, |
| 742 | + callback=params.get('callback')) |
| 743 | + return response |
| 744 | + |
659 | 745 | def patch_guide_version(self, guide_id: str, version_id: str, body: 'UpdateGuideVersion', **kwargs) -> 'GuideVersion': |
660 | 746 | """ |
661 | 747 | Update a guide version. |
|
0 commit comments