ibm-platform-services 0.60.0__tar.gz → 0.61.0__tar.gz

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 (34) hide show
  1. {ibm_platform_services-0.60.0/ibm_platform_services.egg-info → ibm_platform_services-0.61.0}/PKG-INFO +2 -2
  2. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/README.md +1 -1
  3. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/iam_identity_v1.py +482 -54
  4. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/version.py +1 -1
  5. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0/ibm_platform_services.egg-info}/PKG-INFO +2 -2
  6. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/pyproject.toml +1 -1
  7. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/LICENSE +0 -0
  8. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/MANIFEST.in +0 -0
  9. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/__init__.py +0 -0
  10. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/case_management_v1.py +0 -0
  11. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/catalog_management_v1.py +0 -0
  12. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/common.py +0 -0
  13. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/context_based_restrictions_v1.py +0 -0
  14. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/enterprise_billing_units_v1.py +0 -0
  15. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/enterprise_management_v1.py +0 -0
  16. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/enterprise_usage_reports_v1.py +0 -0
  17. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/global_catalog_v1.py +0 -0
  18. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/global_search_v2.py +0 -0
  19. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/global_tagging_v1.py +0 -0
  20. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/iam_access_groups_v2.py +0 -0
  21. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/iam_policy_management_v1.py +0 -0
  22. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/ibm_cloud_shell_v1.py +0 -0
  23. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/open_service_broker_v1.py +0 -0
  24. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/partner_management_v1.py +0 -0
  25. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/resource_controller_v2.py +0 -0
  26. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/resource_manager_v2.py +0 -0
  27. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/usage_metering_v4.py +0 -0
  28. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/usage_reports_v4.py +0 -0
  29. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services/user_management_v1.py +0 -0
  30. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services.egg-info/SOURCES.txt +0 -0
  31. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services.egg-info/dependency_links.txt +0 -0
  32. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services.egg-info/requires.txt +0 -0
  33. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/ibm_platform_services.egg-info/top_level.txt +0 -0
  34. {ibm_platform_services-0.60.0 → ibm_platform_services-0.61.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ibm-platform-services
3
- Version: 0.60.0
3
+ Version: 0.61.0
4
4
  Summary: Python client library for IBM Cloud Platform Services
5
5
  Author-email: IBM <devxsdk@us.ibm.com>
6
6
  Project-URL: Repository, https://github.com/IBM/platform-services-python-sdk
@@ -50,7 +50,7 @@ Requires-Dist: twine; extra == "publish"
50
50
  [![CLA assistant](https://cla-assistant.io/readme/badge/IBM/platform-services-python-sdk)](https://cla-assistant.io/IBM/platform-services-python-sdk)
51
51
 
52
52
 
53
- # IBM Cloud Platform Services Python SDK Version 0.60.0
53
+ # IBM Cloud Platform Services Python SDK Version 0.61.0
54
54
 
55
55
  Python client library to interact with various
56
56
  [IBM Cloud Platform Service APIs](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services).
@@ -8,7 +8,7 @@
8
8
  [![CLA assistant](https://cla-assistant.io/readme/badge/IBM/platform-services-python-sdk)](https://cla-assistant.io/IBM/platform-services-python-sdk)
9
9
 
10
10
 
11
- # IBM Cloud Platform Services Python SDK Version 0.60.0
11
+ # IBM Cloud Platform Services Python SDK Version 0.61.0
12
12
 
13
13
  Python client library to interact with various
14
14
  [IBM Cloud Platform Service APIs](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services).
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- # (C) Copyright IBM Corp. 2024.
3
+ # (C) Copyright IBM Corp. 2025.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- # IBM OpenAPI SDK Code Generator Version: 3.93.0-c40121e6-20240729-182103
17
+ # IBM OpenAPI SDK Code Generator Version: 3.98.0-8be2046a-20241205-162752
18
18
 
19
19
  """
20
20
  The IAM Identity Service API allows for the management of Account Settings and Identities
@@ -96,9 +96,7 @@ class IamIdentityV1(BaseService):
96
96
 
97
97
  Returns the list of API key details for a given service or user IAM ID and account
98
98
  ID. Users can manage user API keys for themself, or service ID API keys for
99
- service IDs that are bound to an entity they have access to. In case of service
100
- IDs and their API keys, a user must be either an account owner, a IBM Cloud org
101
- manager or IBM Cloud space developer in order to manage service IDs of the entity.
99
+ service IDs they have access to.
102
100
 
103
101
  :param str account_id: (optional) Account ID of the API keys to query. If a
104
102
  service IAM ID is specified in iam_id then account_id must match the
@@ -182,8 +180,7 @@ class IamIdentityV1(BaseService):
182
180
  Create an API key.
183
181
 
184
182
  Creates an API key for a UserID or service ID. Users can manage user API keys for
185
- themself, or service ID API keys for service IDs that are bound to an entity they
186
- have access to.
183
+ themself, or service ID API keys for service IDs they have access to.
187
184
 
188
185
  :param str name: Name of the API key. The name is not checked for
189
186
  uniqueness. Therefore multiple names with the same value can exist. Access
@@ -204,8 +201,10 @@ class IamIdentityV1(BaseService):
204
201
  API key value is retrievable in the future by using the Get details of an
205
202
  API key request. If you create an API key for a user, you must specify
206
203
  `false` or omit the value. We don't allow storing of API keys for users.
207
- :param bool support_sessions: (optional) Defines if the API key supports
208
- sessions. Sessions are only supported for user apikeys.
204
+ :param bool support_sessions: (optional) Defines whether you can manage CLI
205
+ login sessions for the API key. When `true`, sessions are created and can
206
+ be reviewed or revoked. When `false`, no sessions are tracked. To block
207
+ access, delete or rotate the API key. Available only for user API keys.
209
208
  :param str action_when_leaked: (optional) Defines the action to take when
210
209
  API key is leaked, valid values are 'none', 'disable' and 'delete'.
211
210
  :param str entity_lock: (optional) Indicates if the API key is locked for
@@ -273,8 +272,7 @@ class IamIdentityV1(BaseService):
273
272
  Get details of an API key by its value.
274
273
 
275
274
  Returns the details of an API key by its value. Users can manage user API keys for
276
- themself, or service ID API keys for service IDs that are bound to an entity they
277
- have access to.
275
+ themself, or service ID API keys for service IDs they have access to.
278
276
 
279
277
  :param str iam_api_key: (optional) API key value.
280
278
  :param bool include_history: (optional) Defines if the entity history is
@@ -326,10 +324,7 @@ class IamIdentityV1(BaseService):
326
324
  Get details of an API key.
327
325
 
328
326
  Returns the details of an API key. Users can manage user API keys for themself, or
329
- service ID API keys for service IDs that are bound to an entity they have access
330
- to. In case of service IDs and their API keys, a user must be either an account
331
- owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage
332
- service IDs of the entity.
327
+ service ID API keys for service IDs they have access to.
333
328
 
334
329
  :param str id: Unique ID of the API key.
335
330
  :param bool include_history: (optional) Defines if the entity history is
@@ -393,9 +388,8 @@ class IamIdentityV1(BaseService):
393
388
  Updates properties of an API key. This does NOT affect existing access tokens.
394
389
  Their token content will stay unchanged until the access token is refreshed. To
395
390
  update an API key, pass the property to be modified. To delete one property's
396
- value, pass the property with an empty value "".Users can manage user API keys for
397
- themself, or service ID API keys for service IDs that are bound to an entity they
398
- have access to.
391
+ value, pass the property with an empty value "". Users can manage user API keys
392
+ for themself, or service ID API keys for service IDs they have access to.
399
393
 
400
394
  :param str id: Unique ID of the API key to be updated.
401
395
  :param str if_match: Version of the API key to be updated. Specify the
@@ -408,8 +402,10 @@ class IamIdentityV1(BaseService):
408
402
  :param str description: (optional) The description of the API key to
409
403
  update. If specified an empty description will clear the description of the
410
404
  API key. If a non empty value is provided the API key will be updated.
411
- :param bool support_sessions: (optional) Defines if the API key supports
412
- sessions. Sessions are only supported for user apikeys.
405
+ :param bool support_sessions: (optional) Defines whether you can manage CLI
406
+ login sessions for the API key. When `true`, sessions are created and can
407
+ be reviewed or revoked. When `false`, no sessions are tracked. To block
408
+ access, delete or rotate the API key. Available only for user API keys.
413
409
  :param str action_when_leaked: (optional) Defines the action to take when
414
410
  API key is leaked, valid values are 'none', 'disable' and 'delete'.
415
411
  :param dict headers: A `dict` containing the request headers
@@ -469,8 +465,8 @@ class IamIdentityV1(BaseService):
469
465
  Deletes an API key.
470
466
 
471
467
  Deletes an API key. Existing tokens will remain valid until expired. Users can
472
- manage user API keys for themself, or service ID API keys for service IDs that are
473
- bound to an entity they have access to.
468
+ manage user API keys for themself, or service ID API keys for service IDs they
469
+ have access to.
474
470
 
475
471
  :param str id: Unique ID of the API key.
476
472
  :param dict headers: A `dict` containing the request headers
@@ -558,10 +554,7 @@ class IamIdentityV1(BaseService):
558
554
  Unlock the API key.
559
555
 
560
556
  Unlocks an API key by ID. Users can manage user API keys for themself, or service
561
- ID API keys for service IDs that are bound to an entity they have access to. In
562
- case of service IDs and their API keys, a user must be either an account owner, a
563
- IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs
564
- of the entity.
557
+ ID API keys for service IDs they have access to.
565
558
 
566
559
  :param str id: Unique ID of the API key.
567
560
  :param dict headers: A `dict` containing the request headers
@@ -602,10 +595,10 @@ class IamIdentityV1(BaseService):
602
595
  **kwargs,
603
596
  ) -> DetailedResponse:
604
597
  """
605
- disable the API key.
598
+ Disable the API key.
606
599
 
607
600
  Disable an API key. Users can manage user API keys for themself, or service ID API
608
- keys for service IDs that are bound to an entity they have access to.
601
+ keys for service IDs they have access to.
609
602
 
610
603
  :param str id: Unique ID of the API key.
611
604
  :param dict headers: A `dict` containing the request headers
@@ -649,7 +642,7 @@ class IamIdentityV1(BaseService):
649
642
  Enable the API key.
650
643
 
651
644
  Enable an API key. Users can manage user API keys for themself, or service ID API
652
- keys for service IDs that are bound to an entity they have access to.
645
+ keys for service IDs they have access to.
653
646
 
654
647
  :param str id: Unique ID of the API key.
655
648
  :param dict headers: A `dict` containing the request headers
@@ -704,9 +697,8 @@ class IamIdentityV1(BaseService):
704
697
  List service IDs.
705
698
 
706
699
  Returns a list of service IDs. Users can manage user API keys for themself, or
707
- service ID API keys for service IDs that are bound to an entity they have access
708
- to. Note: apikey details are only included in the response when creating a Service
709
- ID with an api key.
700
+ service ID API keys for service IDs they have access to. Note: apikey details are
701
+ only included in the response when creating a Service ID with an api key.
710
702
 
711
703
  :param str account_id: (optional) Account ID of the service ID(s) to query.
712
704
  This parameter is required (unless using a pagetoken).
@@ -777,8 +769,7 @@ class IamIdentityV1(BaseService):
777
769
  Create a service ID.
778
770
 
779
771
  Creates a service ID for an IBM Cloud account. Users can manage user API keys for
780
- themself, or service ID API keys for service IDs that are bound to an entity they
781
- have access to.
772
+ themself, or service ID API keys for service IDs they have access to.
782
773
 
783
774
  :param str account_id: ID of the account the service ID belongs to.
784
775
  :param str name: Name of the Service Id. The name is not checked for
@@ -853,9 +844,8 @@ class IamIdentityV1(BaseService):
853
844
  Get details of a service ID.
854
845
 
855
846
  Returns the details of a service ID. Users can manage user API keys for themself,
856
- or service ID API keys for service IDs that are bound to an entity they have
857
- access to. Note: apikey details are only included in the response when creating a
858
- Service ID with an api key.
847
+ or service ID API keys for service IDs they have access to. Note: apikey details
848
+ are only included in the response when creating a Service ID with an api key.
859
849
 
860
850
  :param str id: Unique ID of the service ID.
861
851
  :param bool include_history: (optional) Defines if the entity history is
@@ -919,9 +909,9 @@ class IamIdentityV1(BaseService):
919
909
  Their token content will stay unchanged until the access token is refreshed. To
920
910
  update a service ID, pass the property to be modified. To delete one property's
921
911
  value, pass the property with an empty value "".Users can manage user API keys for
922
- themself, or service ID API keys for service IDs that are bound to an entity they
923
- have access to. Note: apikey details are only included in the response when
924
- creating a Service ID with an apikey.
912
+ themself, or service ID API keys for service IDs they have access to. Note: apikey
913
+ details are only included in the response when creating a Service ID with an
914
+ apikey.
925
915
 
926
916
  :param str id: Unique ID of the service ID to be updated.
927
917
  :param str if_match: Version of the service ID to be updated. Specify the
@@ -998,8 +988,7 @@ class IamIdentityV1(BaseService):
998
988
  service ID, all associated API keys are deleted. In case a Delete Conflict (status
999
989
  code 409) a retry of the request may help as the service ID is only deleted if the
1000
990
  associated API keys were successfully deleted before. Users can manage user API
1001
- keys for themself, or service ID API keys for service IDs that are bound to an
1002
- entity they have access to.
991
+ keys for themself, or service ID API keys for service IDs they have access to.
1003
992
 
1004
993
  :param str id: Unique ID of the service ID.
1005
994
  :param dict headers: A `dict` containing the request headers
@@ -1043,10 +1032,7 @@ class IamIdentityV1(BaseService):
1043
1032
  Lock the service ID.
1044
1033
 
1045
1034
  Locks a service ID by ID. Users can manage user API keys for themself, or service
1046
- ID API keys for service IDs that are bound to an entity they have access to. In
1047
- case of service IDs and their API keys, a user must be either an account owner, a
1048
- IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs
1049
- of the entity.
1035
+ ID API keys for service IDs they have access to.
1050
1036
 
1051
1037
  :param str id: Unique ID of the service ID.
1052
1038
  :param dict headers: A `dict` containing the request headers
@@ -1090,10 +1076,7 @@ class IamIdentityV1(BaseService):
1090
1076
  Unlock the service ID.
1091
1077
 
1092
1078
  Unlocks a service ID by ID. Users can manage user API keys for themself, or
1093
- service ID API keys for service IDs that are bound to an entity they have access
1094
- to. In case of service IDs and their API keys, a user must be either an account
1095
- owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage
1096
- service IDs of the entity.
1079
+ service ID API keys for service IDs they have access to.
1097
1080
 
1098
1081
  :param str id: Unique ID of the service ID.
1099
1082
  :param dict headers: A `dict` containing the request headers
@@ -3721,6 +3704,271 @@ class IamIdentityV1(BaseService):
3721
3704
  response = self.send(request, **kwargs)
3722
3705
  return response
3723
3706
 
3707
+ #########################
3708
+ # identityPreferences
3709
+ #########################
3710
+
3711
+ def update_preference_on_scope_account(
3712
+ self,
3713
+ account_id: str,
3714
+ iam_id: str,
3715
+ service: str,
3716
+ preference_id: str,
3717
+ value_string: str,
3718
+ *,
3719
+ value_list_of_strings: Optional[List[str]] = None,
3720
+ **kwargs,
3721
+ ) -> DetailedResponse:
3722
+ """
3723
+ Update Identity Preference on scope account.
3724
+
3725
+ Update one Identity Preference on scope 'account'. supported preferences:
3726
+ The following preferences are storing values for identities inside an account,
3727
+ i.e. for each account that an identity is member of, the value stored might be
3728
+ different.
3729
+ This means, users who might be member of multiple accounts can have multiple
3730
+ preferences, one per account.
3731
+ Identities like Service Ids or Trusted Profiles can only exist in one account,
3732
+ therefore they can only have one preference inside their related account.
3733
+ preference: console/landing_page
3734
+ service: console
3735
+ preferenceId: landing_page
3736
+ supportedIdentityType: Trusted Profiles, Users
3737
+ type: string
3738
+ validation: valid URL (without host part), e.g. /billing or /iam
3739
+ preference: console/global_left_navigation
3740
+ service: console
3741
+ preferenceId: global_left_navigation
3742
+ supportedIdentityType: Trusted Profiles, Users
3743
+ type: list of strings
3744
+ validation: each entry in the list of strings must match the identifier of one
3745
+ navigation entry in the console.
3746
+
3747
+ :param str account_id: Account id to update preference for.
3748
+ :param str iam_id: IAM id to update the preference for.
3749
+ :param str service: Service of the preference to be updated.
3750
+ :param str preference_id: Identifier of preference to be updated.
3751
+ :param str value_string: contains a string value of the preference. only
3752
+ one value property is set, either 'value_string' or 'value_list_of_strings'
3753
+ is present.
3754
+ :param List[str] value_list_of_strings: (optional) contains a list of
3755
+ string values of the preference. only one value property is set, either
3756
+ 'value_string' or 'value_list_of_strings' is present.
3757
+ :param dict headers: A `dict` containing the request headers
3758
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3759
+ :rtype: DetailedResponse with `dict` result representing a `IdentityPreferenceResponse` object
3760
+ """
3761
+
3762
+ if not account_id:
3763
+ raise ValueError('account_id must be provided')
3764
+ if not iam_id:
3765
+ raise ValueError('iam_id must be provided')
3766
+ if not service:
3767
+ raise ValueError('service must be provided')
3768
+ if not preference_id:
3769
+ raise ValueError('preference_id must be provided')
3770
+ if value_string is None:
3771
+ raise ValueError('value_string must be provided')
3772
+ headers = {}
3773
+ sdk_headers = get_sdk_headers(
3774
+ service_name=self.DEFAULT_SERVICE_NAME,
3775
+ service_version='V1',
3776
+ operation_id='update_preference_on_scope_account',
3777
+ )
3778
+ headers.update(sdk_headers)
3779
+
3780
+ data = {
3781
+ 'value_string': value_string,
3782
+ 'value_list_of_strings': value_list_of_strings,
3783
+ }
3784
+ data = {k: v for (k, v) in data.items() if v is not None}
3785
+ data = json.dumps(data)
3786
+ headers['content-type'] = 'application/json'
3787
+
3788
+ if 'headers' in kwargs:
3789
+ headers.update(kwargs.get('headers'))
3790
+ del kwargs['headers']
3791
+ headers['Accept'] = 'application/json'
3792
+
3793
+ path_param_keys = ['account_id', 'iam_id', 'service', 'preference_id']
3794
+ path_param_values = self.encode_path_vars(account_id, iam_id, service, preference_id)
3795
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3796
+ url = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.format(
3797
+ **path_param_dict
3798
+ )
3799
+ request = self.prepare_request(
3800
+ method='PUT',
3801
+ url=url,
3802
+ headers=headers,
3803
+ data=data,
3804
+ )
3805
+
3806
+ response = self.send(request, **kwargs)
3807
+ return response
3808
+
3809
+ def delete_preferences_on_scope_account(
3810
+ self,
3811
+ account_id: str,
3812
+ iam_id: str,
3813
+ service: str,
3814
+ preference_id: str,
3815
+ **kwargs,
3816
+ ) -> DetailedResponse:
3817
+ """
3818
+ Delete Identity Preference on scope account.
3819
+
3820
+ Delete one Identity Preference on scope 'account'.
3821
+
3822
+ :param str account_id: Account id to delete preference for.
3823
+ :param str iam_id: IAM id to delete the preference for.
3824
+ :param str service: Service of the preference to be deleted.
3825
+ :param str preference_id: Identifier of preference to be deleted.
3826
+ :param dict headers: A `dict` containing the request headers
3827
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3828
+ :rtype: DetailedResponse
3829
+ """
3830
+
3831
+ if not account_id:
3832
+ raise ValueError('account_id must be provided')
3833
+ if not iam_id:
3834
+ raise ValueError('iam_id must be provided')
3835
+ if not service:
3836
+ raise ValueError('service must be provided')
3837
+ if not preference_id:
3838
+ raise ValueError('preference_id must be provided')
3839
+ headers = {}
3840
+ sdk_headers = get_sdk_headers(
3841
+ service_name=self.DEFAULT_SERVICE_NAME,
3842
+ service_version='V1',
3843
+ operation_id='delete_preferences_on_scope_account',
3844
+ )
3845
+ headers.update(sdk_headers)
3846
+
3847
+ if 'headers' in kwargs:
3848
+ headers.update(kwargs.get('headers'))
3849
+ del kwargs['headers']
3850
+
3851
+ path_param_keys = ['account_id', 'iam_id', 'service', 'preference_id']
3852
+ path_param_values = self.encode_path_vars(account_id, iam_id, service, preference_id)
3853
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3854
+ url = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.format(
3855
+ **path_param_dict
3856
+ )
3857
+ request = self.prepare_request(
3858
+ method='DELETE',
3859
+ url=url,
3860
+ headers=headers,
3861
+ )
3862
+
3863
+ response = self.send(request, **kwargs)
3864
+ return response
3865
+
3866
+ def get_preferences_on_scope_account(
3867
+ self,
3868
+ account_id: str,
3869
+ iam_id: str,
3870
+ service: str,
3871
+ preference_id: str,
3872
+ **kwargs,
3873
+ ) -> DetailedResponse:
3874
+ """
3875
+ Get Identity Preference on scope account.
3876
+
3877
+ Get one Identity Preference on scope 'account'.
3878
+
3879
+ :param str account_id: Account id to get preference for.
3880
+ :param str iam_id: IAM id to get the preference for.
3881
+ :param str service: Service of the preference to be fetched.
3882
+ :param str preference_id: Identifier of preference to be fetched.
3883
+ :param dict headers: A `dict` containing the request headers
3884
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3885
+ :rtype: DetailedResponse with `dict` result representing a `IdentityPreferenceResponse` object
3886
+ """
3887
+
3888
+ if not account_id:
3889
+ raise ValueError('account_id must be provided')
3890
+ if not iam_id:
3891
+ raise ValueError('iam_id must be provided')
3892
+ if not service:
3893
+ raise ValueError('service must be provided')
3894
+ if not preference_id:
3895
+ raise ValueError('preference_id must be provided')
3896
+ headers = {}
3897
+ sdk_headers = get_sdk_headers(
3898
+ service_name=self.DEFAULT_SERVICE_NAME,
3899
+ service_version='V1',
3900
+ operation_id='get_preferences_on_scope_account',
3901
+ )
3902
+ headers.update(sdk_headers)
3903
+
3904
+ if 'headers' in kwargs:
3905
+ headers.update(kwargs.get('headers'))
3906
+ del kwargs['headers']
3907
+ headers['Accept'] = 'application/json'
3908
+
3909
+ path_param_keys = ['account_id', 'iam_id', 'service', 'preference_id']
3910
+ path_param_values = self.encode_path_vars(account_id, iam_id, service, preference_id)
3911
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3912
+ url = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.format(
3913
+ **path_param_dict
3914
+ )
3915
+ request = self.prepare_request(
3916
+ method='GET',
3917
+ url=url,
3918
+ headers=headers,
3919
+ )
3920
+
3921
+ response = self.send(request, **kwargs)
3922
+ return response
3923
+
3924
+ def get_all_preferences_on_scope_account(
3925
+ self,
3926
+ account_id: str,
3927
+ iam_id: str,
3928
+ **kwargs,
3929
+ ) -> DetailedResponse:
3930
+ """
3931
+ Get all Identity Preferences for one account.
3932
+
3933
+ Get all Identity Preferences for one account / user combination.
3934
+
3935
+ :param str account_id: Account id to get preferences for.
3936
+ :param str iam_id: IAM id to get the preferences for.
3937
+ :param dict headers: A `dict` containing the request headers
3938
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3939
+ :rtype: DetailedResponse with `dict` result representing a `IdentityPreferencesResponse` object
3940
+ """
3941
+
3942
+ if not account_id:
3943
+ raise ValueError('account_id must be provided')
3944
+ if not iam_id:
3945
+ raise ValueError('iam_id must be provided')
3946
+ headers = {}
3947
+ sdk_headers = get_sdk_headers(
3948
+ service_name=self.DEFAULT_SERVICE_NAME,
3949
+ service_version='V1',
3950
+ operation_id='get_all_preferences_on_scope_account',
3951
+ )
3952
+ headers.update(sdk_headers)
3953
+
3954
+ if 'headers' in kwargs:
3955
+ headers.update(kwargs.get('headers'))
3956
+ del kwargs['headers']
3957
+ headers['Accept'] = 'application/json'
3958
+
3959
+ path_param_keys = ['account_id', 'iam_id']
3960
+ path_param_values = self.encode_path_vars(account_id, iam_id)
3961
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3962
+ url = '/v1/preferences/accounts/{account_id}/identities/{iam_id}'.format(**path_param_dict)
3963
+ request = self.prepare_request(
3964
+ method='GET',
3965
+ url=url,
3966
+ headers=headers,
3967
+ )
3968
+
3969
+ response = self.send(request, **kwargs)
3970
+ return response
3971
+
3724
3972
  #########################
3725
3973
  # trustedProfileAssignments
3726
3974
  #########################
@@ -7305,8 +7553,10 @@ class ApiKey:
7305
7553
  :param str name: Name of the API key. The name is not checked for uniqueness.
7306
7554
  Therefore multiple names with the same value can exist. Access is done via the
7307
7555
  UUID of the API key.
7308
- :param bool support_sessions: (optional) Defines if the API key supports
7309
- sessions. Sessions are only supported for user apikeys.
7556
+ :param bool support_sessions: (optional) Defines whether you can manage CLI
7557
+ login sessions for the API key. When `true`, sessions are created and can be
7558
+ reviewed or revoked. When `false`, no sessions are tracked. To block access,
7559
+ delete or rotate the API key. Available only for user API keys.
7310
7560
  :param str action_when_leaked: (optional) Defines the action to take when API
7311
7561
  key is leaked, valid values are 'none', 'disable' and 'delete'.
7312
7562
  :param str description: (optional) The optional description of the API key. The
@@ -7379,8 +7629,10 @@ class ApiKey:
7379
7629
  of the creation date in ISO format.
7380
7630
  :param datetime modified_at: (optional) If set contains a date time string
7381
7631
  of the last modification date in ISO format.
7382
- :param bool support_sessions: (optional) Defines if the API key supports
7383
- sessions. Sessions are only supported for user apikeys.
7632
+ :param bool support_sessions: (optional) Defines whether you can manage CLI
7633
+ login sessions for the API key. When `true`, sessions are created and can
7634
+ be reviewed or revoked. When `false`, no sessions are tracked. To block
7635
+ access, delete or rotate the API key. Available only for user API keys.
7384
7636
  :param str action_when_leaked: (optional) Defines the action to take when
7385
7637
  API key is leaked, valid values are 'none', 'disable' and 'delete'.
7386
7638
  :param str description: (optional) The optional description of the API key.
@@ -8988,6 +9240,182 @@ class IdBasedMfaEnrollment:
8988
9240
  CROSS_ACCOUNT = 'CROSS_ACCOUNT'
8989
9241
 
8990
9242
 
9243
+ class IdentityPreferenceResponse:
9244
+ """
9245
+ IdentityPreferenceResponse.
9246
+
9247
+ :param str service: (optional) Service of the preference.
9248
+ :param str id: (optional) Unique ID of the preference.
9249
+ :param str account_id: (optional) Account ID of the preference, only present for
9250
+ scope 'account'.
9251
+ :param str scope: (optional) Scope of the preference, 'global' or 'account'.
9252
+ :param str value_string: (optional) String value of the preference, only one
9253
+ value property is set, either 'value_string' or 'value_list_of_strings' is
9254
+ present.
9255
+ :param List[str] value_list_of_strings: (optional) List of value of the
9256
+ preference, only one value property is set, either 'value_string' or
9257
+ 'value_list_of_strings' is present.
9258
+ """
9259
+
9260
+ def __init__(
9261
+ self,
9262
+ *,
9263
+ service: Optional[str] = None,
9264
+ id: Optional[str] = None,
9265
+ account_id: Optional[str] = None,
9266
+ scope: Optional[str] = None,
9267
+ value_string: Optional[str] = None,
9268
+ value_list_of_strings: Optional[List[str]] = None,
9269
+ ) -> None:
9270
+ """
9271
+ Initialize a IdentityPreferenceResponse object.
9272
+
9273
+ :param str service: (optional) Service of the preference.
9274
+ :param str id: (optional) Unique ID of the preference.
9275
+ :param str account_id: (optional) Account ID of the preference, only
9276
+ present for scope 'account'.
9277
+ :param str scope: (optional) Scope of the preference, 'global' or
9278
+ 'account'.
9279
+ :param str value_string: (optional) String value of the preference, only
9280
+ one value property is set, either 'value_string' or 'value_list_of_strings'
9281
+ is present.
9282
+ :param List[str] value_list_of_strings: (optional) List of value of the
9283
+ preference, only one value property is set, either 'value_string' or
9284
+ 'value_list_of_strings' is present.
9285
+ """
9286
+ self.service = service
9287
+ self.id = id
9288
+ self.account_id = account_id
9289
+ self.scope = scope
9290
+ self.value_string = value_string
9291
+ self.value_list_of_strings = value_list_of_strings
9292
+
9293
+ @classmethod
9294
+ def from_dict(cls, _dict: Dict) -> 'IdentityPreferenceResponse':
9295
+ """Initialize a IdentityPreferenceResponse object from a json dictionary."""
9296
+ args = {}
9297
+ if (service := _dict.get('service')) is not None:
9298
+ args['service'] = service
9299
+ if (id := _dict.get('id')) is not None:
9300
+ args['id'] = id
9301
+ if (account_id := _dict.get('account_id')) is not None:
9302
+ args['account_id'] = account_id
9303
+ if (scope := _dict.get('scope')) is not None:
9304
+ args['scope'] = scope
9305
+ if (value_string := _dict.get('value_string')) is not None:
9306
+ args['value_string'] = value_string
9307
+ if (value_list_of_strings := _dict.get('value_list_of_strings')) is not None:
9308
+ args['value_list_of_strings'] = value_list_of_strings
9309
+ return cls(**args)
9310
+
9311
+ @classmethod
9312
+ def _from_dict(cls, _dict):
9313
+ """Initialize a IdentityPreferenceResponse object from a json dictionary."""
9314
+ return cls.from_dict(_dict)
9315
+
9316
+ def to_dict(self) -> Dict:
9317
+ """Return a json dictionary representing this model."""
9318
+ _dict = {}
9319
+ if hasattr(self, 'service') and self.service is not None:
9320
+ _dict['service'] = self.service
9321
+ if hasattr(self, 'id') and self.id is not None:
9322
+ _dict['id'] = self.id
9323
+ if hasattr(self, 'account_id') and self.account_id is not None:
9324
+ _dict['account_id'] = self.account_id
9325
+ if hasattr(self, 'scope') and self.scope is not None:
9326
+ _dict['scope'] = self.scope
9327
+ if hasattr(self, 'value_string') and self.value_string is not None:
9328
+ _dict['value_string'] = self.value_string
9329
+ if hasattr(self, 'value_list_of_strings') and self.value_list_of_strings is not None:
9330
+ _dict['value_list_of_strings'] = self.value_list_of_strings
9331
+ return _dict
9332
+
9333
+ def _to_dict(self):
9334
+ """Return a json dictionary representing this model."""
9335
+ return self.to_dict()
9336
+
9337
+ def __str__(self) -> str:
9338
+ """Return a `str` version of this IdentityPreferenceResponse object."""
9339
+ return json.dumps(self.to_dict(), indent=2)
9340
+
9341
+ def __eq__(self, other: 'IdentityPreferenceResponse') -> bool:
9342
+ """Return `true` when self and other are equal, false otherwise."""
9343
+ if not isinstance(other, self.__class__):
9344
+ return False
9345
+ return self.__dict__ == other.__dict__
9346
+
9347
+ def __ne__(self, other: 'IdentityPreferenceResponse') -> bool:
9348
+ """Return `true` when self and other are not equal, false otherwise."""
9349
+ return not self == other
9350
+
9351
+
9352
+ class IdentityPreferencesResponse:
9353
+ """
9354
+ IdentityPreferencesResponse.
9355
+
9356
+ :param List[IdentityPreferenceResponse] preferences: List of Identity
9357
+ Preferences.
9358
+ """
9359
+
9360
+ def __init__(
9361
+ self,
9362
+ preferences: List['IdentityPreferenceResponse'],
9363
+ ) -> None:
9364
+ """
9365
+ Initialize a IdentityPreferencesResponse object.
9366
+
9367
+ :param List[IdentityPreferenceResponse] preferences: List of Identity
9368
+ Preferences.
9369
+ """
9370
+ self.preferences = preferences
9371
+
9372
+ @classmethod
9373
+ def from_dict(cls, _dict: Dict) -> 'IdentityPreferencesResponse':
9374
+ """Initialize a IdentityPreferencesResponse object from a json dictionary."""
9375
+ args = {}
9376
+ if (preferences := _dict.get('preferences')) is not None:
9377
+ args['preferences'] = [IdentityPreferenceResponse.from_dict(v) for v in preferences]
9378
+ else:
9379
+ raise ValueError('Required property \'preferences\' not present in IdentityPreferencesResponse JSON')
9380
+ return cls(**args)
9381
+
9382
+ @classmethod
9383
+ def _from_dict(cls, _dict):
9384
+ """Initialize a IdentityPreferencesResponse object from a json dictionary."""
9385
+ return cls.from_dict(_dict)
9386
+
9387
+ def to_dict(self) -> Dict:
9388
+ """Return a json dictionary representing this model."""
9389
+ _dict = {}
9390
+ if hasattr(self, 'preferences') and self.preferences is not None:
9391
+ preferences_list = []
9392
+ for v in self.preferences:
9393
+ if isinstance(v, dict):
9394
+ preferences_list.append(v)
9395
+ else:
9396
+ preferences_list.append(v.to_dict())
9397
+ _dict['preferences'] = preferences_list
9398
+ return _dict
9399
+
9400
+ def _to_dict(self):
9401
+ """Return a json dictionary representing this model."""
9402
+ return self.to_dict()
9403
+
9404
+ def __str__(self) -> str:
9405
+ """Return a `str` version of this IdentityPreferencesResponse object."""
9406
+ return json.dumps(self.to_dict(), indent=2)
9407
+
9408
+ def __eq__(self, other: 'IdentityPreferencesResponse') -> bool:
9409
+ """Return `true` when self and other are equal, false otherwise."""
9410
+ if not isinstance(other, self.__class__):
9411
+ return False
9412
+ return self.__dict__ == other.__dict__
9413
+
9414
+ def __ne__(self, other: 'IdentityPreferencesResponse') -> bool:
9415
+ """Return `true` when self and other are not equal, false otherwise."""
9416
+ return not self == other
9417
+
9418
+
8991
9419
  class MfaEnrollmentTypeStatus:
8992
9420
  """
8993
9421
  MfaEnrollmentTypeStatus.
@@ -2,4 +2,4 @@
2
2
  Version of platform_services
3
3
  """
4
4
 
5
- __version__ = '0.60.0'
5
+ __version__ = '0.61.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ibm-platform-services
3
- Version: 0.60.0
3
+ Version: 0.61.0
4
4
  Summary: Python client library for IBM Cloud Platform Services
5
5
  Author-email: IBM <devxsdk@us.ibm.com>
6
6
  Project-URL: Repository, https://github.com/IBM/platform-services-python-sdk
@@ -50,7 +50,7 @@ Requires-Dist: twine; extra == "publish"
50
50
  [![CLA assistant](https://cla-assistant.io/readme/badge/IBM/platform-services-python-sdk)](https://cla-assistant.io/IBM/platform-services-python-sdk)
51
51
 
52
52
 
53
- # IBM Cloud Platform Services Python SDK Version 0.60.0
53
+ # IBM Cloud Platform Services Python SDK Version 0.61.0
54
54
 
55
55
  Python client library to interact with various
56
56
  [IBM Cloud Platform Service APIs](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ibm-platform-services"
3
- version = "0.60.0"
3
+ version = "0.61.0"
4
4
  authors = [
5
5
  { name="IBM", email="devxsdk@us.ibm.com" }
6
6
  ]