ibm-platform-services 0.55.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. ibm_platform_services/__init__.py +43 -0
  2. ibm_platform_services/case_management_v1.py +2414 -0
  3. ibm_platform_services/catalog_management_v1.py +10127 -0
  4. ibm_platform_services/common.py +56 -0
  5. ibm_platform_services/context_based_restrictions_v1.py +3633 -0
  6. ibm_platform_services/enterprise_billing_units_v1.py +1324 -0
  7. ibm_platform_services/enterprise_management_v1.py +2497 -0
  8. ibm_platform_services/enterprise_usage_reports_v1.py +978 -0
  9. ibm_platform_services/global_catalog_v1.py +5129 -0
  10. ibm_platform_services/global_search_v2.py +497 -0
  11. ibm_platform_services/global_tagging_v1.py +1601 -0
  12. ibm_platform_services/iam_access_groups_v2.py +7684 -0
  13. ibm_platform_services/iam_identity_v1.py +11525 -0
  14. ibm_platform_services/iam_policy_management_v1.py +9016 -0
  15. ibm_platform_services/ibm_cloud_shell_v1.py +480 -0
  16. ibm_platform_services/open_service_broker_v1.py +1774 -0
  17. ibm_platform_services/partner_billing_units_v1.py +1381 -0
  18. ibm_platform_services/partner_usage_reports_v1.py +1091 -0
  19. ibm_platform_services/resource_controller_v2.py +4868 -0
  20. ibm_platform_services/resource_manager_v2.py +986 -0
  21. ibm_platform_services/usage_metering_v4.py +470 -0
  22. ibm_platform_services/usage_reports_v4.py +5165 -0
  23. ibm_platform_services/user_management_v1.py +1639 -0
  24. ibm_platform_services/version.py +5 -0
  25. ibm_platform_services-0.55.3.dist-info/LICENSE +201 -0
  26. ibm_platform_services-0.55.3.dist-info/METADATA +165 -0
  27. ibm_platform_services-0.55.3.dist-info/RECORD +29 -0
  28. ibm_platform_services-0.55.3.dist-info/WHEEL +5 -0
  29. ibm_platform_services-0.55.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,56 @@
1
+ # coding: utf-8
2
+
3
+ # Copyright 2020 IBM All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ """
18
+ This module provides common methods for use across all service modules.
19
+ """
20
+
21
+ import platform
22
+ from .version import __version__
23
+
24
+ HEADER_NAME_USER_AGENT = 'User-Agent'
25
+ SDK_NAME = 'platform-services-python-sdk'
26
+
27
+
28
+ def get_system_info():
29
+ """
30
+ Get information about the system to be inserted into the User-Agent header
31
+ """
32
+ format_msg = '(lang=python; os.name={0}; os.version={1}; python.version={2})'
33
+ return format_msg.format(
34
+ platform.system(), platform.release(), platform.python_version() # OS # OS version
35
+ ) # Python version
36
+
37
+
38
+ def get_user_agent():
39
+ """
40
+ Get the value to be sent in the User-Agent header
41
+ """
42
+ return USER_AGENT
43
+
44
+
45
+ USER_AGENT = '{0}/{1} {2}'.format(SDK_NAME, __version__, get_system_info())
46
+
47
+
48
+ def get_sdk_headers(service_name, service_version, operation_id):
49
+ # pylint: disable=unused-argument
50
+
51
+ """
52
+ Get the request headers to be sent in requests by the SDK
53
+ """
54
+ headers = {}
55
+ headers[HEADER_NAME_USER_AGENT] = get_user_agent()
56
+ return headers