|
46 | 46 | from ..models import IpAddressAuthentication |
47 | 47 | from ..models import LimitChangeRequestDetails |
48 | 48 | from ..models import LimitChangeRequestsEntityListing |
| 49 | +from ..models import LimitCountListing |
49 | 50 | from ..models import LimitDocumentation |
50 | 51 | from ..models import LimitsEntityListing |
51 | 52 | from ..models import OrgAuthSettings |
@@ -753,6 +754,93 @@ def get_organizations_limits_namespace(self, namespace_name: str, **kwargs) -> ' |
753 | 754 | callback=params.get('callback')) |
754 | 755 | return response |
755 | 756 |
|
| 757 | + def get_organizations_limits_namespace_counts(self, namespace_name: str, **kwargs) -> 'LimitCountListing': |
| 758 | + """ |
| 759 | + Get estimated limit counts for a namespace. This is not a source of truth for limit values but a record of estimates to facilitate limit threshold tracking. |
| 760 | + See https://developer.genesys.cloud/organization/organization/limits#available-limits for limits that are trackable (Operational Events Enabled). |
| 761 | +
|
| 762 | + This method makes a synchronous HTTP request by default. To make an |
| 763 | + asynchronous HTTP request, please define a `callback` function |
| 764 | + to be invoked when receiving the response. |
| 765 | + >>> def callback_function(response): |
| 766 | + >>> pprint(response) |
| 767 | + >>> |
| 768 | + >>> thread = api.get_organizations_limits_namespace_counts(namespace_name, callback=callback_function) |
| 769 | +
|
| 770 | + :param callback function: The callback function |
| 771 | + for asynchronous request. (optional) |
| 772 | + :param str namespace_name: The namespace to get (required) |
| 773 | + :param str cursor: Cursor provided when retrieving the last page |
| 774 | + :param str entity_id: entity id of the count |
| 775 | + :param str user_id: userid of the count |
| 776 | + :return: LimitCountListing |
| 777 | + If the method is called asynchronously, |
| 778 | + returns the request thread. |
| 779 | + """ |
| 780 | + |
| 781 | + all_params = ['namespace_name', 'cursor', 'entity_id', 'user_id'] |
| 782 | + all_params.append('callback') |
| 783 | + |
| 784 | + params = locals() |
| 785 | + for key, val in iteritems(params['kwargs']): |
| 786 | + if key not in all_params: |
| 787 | + raise TypeError( |
| 788 | + "Got an unexpected keyword argument '%s'" |
| 789 | + " to method get_organizations_limits_namespace_counts" % key |
| 790 | + ) |
| 791 | + params[key] = val |
| 792 | + del params['kwargs'] |
| 793 | + |
| 794 | + # verify the required parameter 'namespace_name' is set |
| 795 | + if ('namespace_name' not in params) or (params['namespace_name'] is None): |
| 796 | + raise ValueError("Missing the required parameter `namespace_name` when calling `get_organizations_limits_namespace_counts`") |
| 797 | + |
| 798 | + |
| 799 | + resource_path = '/api/v2/organizations/limits/namespaces/{namespaceName}/counts'.replace('{format}', 'json') |
| 800 | + path_params = {} |
| 801 | + if 'namespace_name' in params: |
| 802 | + path_params['namespaceName'] = params['namespace_name'] |
| 803 | + |
| 804 | + query_params = {} |
| 805 | + if 'cursor' in params: |
| 806 | + query_params['cursor'] = params['cursor'] |
| 807 | + if 'entity_id' in params: |
| 808 | + query_params['entityId'] = params['entity_id'] |
| 809 | + if 'user_id' in params: |
| 810 | + query_params['userId'] = params['user_id'] |
| 811 | + |
| 812 | + header_params = {} |
| 813 | + |
| 814 | + form_params = [] |
| 815 | + local_var_files = {} |
| 816 | + |
| 817 | + body_params = None |
| 818 | + |
| 819 | + # HTTP header `Accept` |
| 820 | + header_params['Accept'] = self.api_client.\ |
| 821 | + select_header_accept(['application/json']) |
| 822 | + if not header_params['Accept']: |
| 823 | + del header_params['Accept'] |
| 824 | + |
| 825 | + # HTTP header `Content-Type` |
| 826 | + header_params['Content-Type'] = self.api_client.\ |
| 827 | + select_header_content_type(['application/json']) |
| 828 | + |
| 829 | + # Authentication setting |
| 830 | + auth_settings = ['PureCloud OAuth'] |
| 831 | + |
| 832 | + response = self.api_client.call_api(resource_path, 'GET', |
| 833 | + path_params, |
| 834 | + query_params, |
| 835 | + header_params, |
| 836 | + body=body_params, |
| 837 | + post_params=form_params, |
| 838 | + files=local_var_files, |
| 839 | + response_type='LimitCountListing', |
| 840 | + auth_settings=auth_settings, |
| 841 | + callback=params.get('callback')) |
| 842 | + return response |
| 843 | + |
756 | 844 | def get_organizations_limits_namespace_defaults(self, namespace_name: str, **kwargs) -> 'LimitsEntityListing': |
757 | 845 | """ |
758 | 846 | Get the default limits in a namespace for an organization |
@@ -831,6 +919,99 @@ def get_organizations_limits_namespace_defaults(self, namespace_name: str, **kwa |
831 | 919 | callback=params.get('callback')) |
832 | 920 | return response |
833 | 921 |
|
| 922 | + def get_organizations_limits_namespace_limit_counts(self, namespace_name: str, limit_name: str, **kwargs) -> 'LimitCountListing': |
| 923 | + """ |
| 924 | + Get estimated limit counts for a namespace and limit name. This is not a source of truth for limit values but a record of estimates to facilitate limit threshold tracking. |
| 925 | + See https://developer.genesys.cloud/organization/organization/limits#available-limits for limits that are trackable (Operational Events Enabled). |
| 926 | +
|
| 927 | + This method makes a synchronous HTTP request by default. To make an |
| 928 | + asynchronous HTTP request, please define a `callback` function |
| 929 | + to be invoked when receiving the response. |
| 930 | + >>> def callback_function(response): |
| 931 | + >>> pprint(response) |
| 932 | + >>> |
| 933 | + >>> thread = api.get_organizations_limits_namespace_limit_counts(namespace_name, limit_name, callback=callback_function) |
| 934 | +
|
| 935 | + :param callback function: The callback function |
| 936 | + for asynchronous request. (optional) |
| 937 | + :param str namespace_name: The namespace to get (required) |
| 938 | + :param str limit_name: The limit to get (required) |
| 939 | + :param str entity_id: entity id of the count |
| 940 | + :param str user_id: userid of the count |
| 941 | + :param str cursor: Cursor provided when retrieving the last page |
| 942 | + :return: LimitCountListing |
| 943 | + If the method is called asynchronously, |
| 944 | + returns the request thread. |
| 945 | + """ |
| 946 | + |
| 947 | + all_params = ['namespace_name', 'limit_name', 'entity_id', 'user_id', 'cursor'] |
| 948 | + all_params.append('callback') |
| 949 | + |
| 950 | + params = locals() |
| 951 | + for key, val in iteritems(params['kwargs']): |
| 952 | + if key not in all_params: |
| 953 | + raise TypeError( |
| 954 | + "Got an unexpected keyword argument '%s'" |
| 955 | + " to method get_organizations_limits_namespace_limit_counts" % key |
| 956 | + ) |
| 957 | + params[key] = val |
| 958 | + del params['kwargs'] |
| 959 | + |
| 960 | + # verify the required parameter 'namespace_name' is set |
| 961 | + if ('namespace_name' not in params) or (params['namespace_name'] is None): |
| 962 | + raise ValueError("Missing the required parameter `namespace_name` when calling `get_organizations_limits_namespace_limit_counts`") |
| 963 | + # verify the required parameter 'limit_name' is set |
| 964 | + if ('limit_name' not in params) or (params['limit_name'] is None): |
| 965 | + raise ValueError("Missing the required parameter `limit_name` when calling `get_organizations_limits_namespace_limit_counts`") |
| 966 | + |
| 967 | + |
| 968 | + resource_path = '/api/v2/organizations/limits/namespaces/{namespaceName}/limits/{limitName}/counts'.replace('{format}', 'json') |
| 969 | + path_params = {} |
| 970 | + if 'namespace_name' in params: |
| 971 | + path_params['namespaceName'] = params['namespace_name'] |
| 972 | + if 'limit_name' in params: |
| 973 | + path_params['limitName'] = params['limit_name'] |
| 974 | + |
| 975 | + query_params = {} |
| 976 | + if 'entity_id' in params: |
| 977 | + query_params['entityId'] = params['entity_id'] |
| 978 | + if 'user_id' in params: |
| 979 | + query_params['userId'] = params['user_id'] |
| 980 | + if 'cursor' in params: |
| 981 | + query_params['cursor'] = params['cursor'] |
| 982 | + |
| 983 | + header_params = {} |
| 984 | + |
| 985 | + form_params = [] |
| 986 | + local_var_files = {} |
| 987 | + |
| 988 | + body_params = None |
| 989 | + |
| 990 | + # HTTP header `Accept` |
| 991 | + header_params['Accept'] = self.api_client.\ |
| 992 | + select_header_accept(['application/json']) |
| 993 | + if not header_params['Accept']: |
| 994 | + del header_params['Accept'] |
| 995 | + |
| 996 | + # HTTP header `Content-Type` |
| 997 | + header_params['Content-Type'] = self.api_client.\ |
| 998 | + select_header_content_type(['application/json']) |
| 999 | + |
| 1000 | + # Authentication setting |
| 1001 | + auth_settings = ['PureCloud OAuth'] |
| 1002 | + |
| 1003 | + response = self.api_client.call_api(resource_path, 'GET', |
| 1004 | + path_params, |
| 1005 | + query_params, |
| 1006 | + header_params, |
| 1007 | + body=body_params, |
| 1008 | + post_params=form_params, |
| 1009 | + files=local_var_files, |
| 1010 | + response_type='LimitCountListing', |
| 1011 | + auth_settings=auth_settings, |
| 1012 | + callback=params.get('callback')) |
| 1013 | + return response |
| 1014 | + |
834 | 1015 | def get_organizations_limits_namespaces(self, **kwargs) -> object: |
835 | 1016 | """ |
836 | 1017 | Get the available limit namespaces |
|
0 commit comments